static final Pattern PARENTHESIZED = Pattern.compile("\\(([^)]+)\\)");
static final Pattern CURLY_BRACED = Pattern.compile("\\{([^}]+)\\}");
+ // http://www.regular-expressions.info/unicode.html
static final Pattern NON_CHAR_DASH = Pattern.compile("[^-'\\p{L}\\p{M}\\p{N}]+");
public static final Pattern NON_CHAR = Pattern.compile("[^\\p{L}\\p{M}\\p{N}]+");
return;
}
final String[] fields = fieldSplit.split(line);
- if (fields.length != 2) {
+ // dictcc now has a part of speech field as field #3.
+ if (fields.length < 2 || fields.length > 3) {
logger.warning("Malformed line: " + line);
return;
}
subfields[0] = new String[] { fields[0] };
subfields[1] = new String[] { fields[1] };
}
-
+
final PairEntry pairEntry = new PairEntry(entrySource);
for (int i = 0; i < subfields[0].length; ++i) {
subfields[0][i] = subfields[0][i].trim();
pairEntry.pairs.add(new Pair(subfields[0][i], subfields[1][i]));
}
final IndexedEntry entryData = new IndexedEntry(pairEntry);
+ entryData.isValid = true;
for (int l = 0; l < 2; ++l) {
// alreadyDone.clear();