Skip to content

Commit

Permalink
[de] add exception for German postag to PatterTestTool
Browse files Browse the repository at this point in the history
  • Loading branch information
f-knorr committed Jul 25, 2017
1 parent 804b42c commit ffcc51d
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ public final class PatternTestTools {
private static final Pattern CHAR_SET_PATTERN = Pattern.compile("\\[^?([^\\]]+)\\]");
private static final Pattern STRICT_CHAR_SET_PATTERN = Pattern.compile("(\\(\\?-i\\))?.*(?<!\\\\)\\[^?([^\\]]+)\\]");

/*
* These strings are not be recognized as a regular expression
*/
private static final Set<String> NO_REGEXP = new HashSet<>(Arrays.asList(
"PRP:LOK+TMP+MOD:DAT+AKK"
));


private PatternTestTools() {
}

Expand Down Expand Up @@ -332,7 +340,7 @@ private static void warnIfElementNotKosher(
: PROBABLE_PATTERN; // something else than Polish POS tag.

if (!isRegularExpression && stringValue.length() > 1
&& regexPattern.matcher(stringValue).find()) {
&& regexPattern.matcher(stringValue).find() && !NO_REGEXP.contains(stringValue)) {
System.err.println("The " + lang + " rule: "
+ ruleId + ", token [" + tokenIndex + "], contains " + "\"" + stringValue
+ "\" that is not marked as regular expression but probably is one.");
Expand Down

0 comments on commit ffcc51d

Please sign in to comment.