Improved rules for automatic capitalization at the begining of a sentence (#314)
Co-authored-by: Alex Knop <alexknoptech@protonmail.com>
This commit is contained in:
parent
8a1fbe5a6a
commit
60da04fa6e
1 changed files with 1 additions and 1 deletions
|
|
@ -7,7 +7,7 @@ public class TextTools {
|
|||
private static final Pattern previousIsLetter = Pattern.compile("\\p{L}$");
|
||||
private static final Pattern nextIsPunctuation = Pattern.compile("^\\p{Punct}");
|
||||
private static final Pattern nextToWord = Pattern.compile("\\b$");
|
||||
private static final Pattern startOfSentence = Pattern.compile("(?<!\\.)(^|[.?!¿¡])\\s*$");
|
||||
private static final Pattern startOfSentence = Pattern.compile("(?<!\\.)(^|[.?!¿¡])\\s+$");
|
||||
|
||||
public static boolean containsOtherThan1(String str) {
|
||||
return str != null && containsOtherThan1.matcher(str).find();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue