private static class Entry { public final String tokensRegex; public final String[] regex; // the regex, tokenized by splitting on white space public final String[] types; // the associated types public final Set<String> overwritableTypes; // what types can be overwritten by this entry public final double priority; public final double weight; public final int annotateGroup; public Entry(String tokensRegex, String[] regex, String[] types, Set<String> overwritableTypes, double priority, double weight, int annotateGroup) { this.tokensRegex = tokensRegex; this.regex = regex; this.types = new String[types.length]; for (int i = 0; i < types.length; i++) { // TODO: for some types, it doesn't make sense to be interning... this.types[i] = types[i].intern(); } this.overwritableTypes = overwritableTypes; this.priority = priority; this.weight = weight; this.annotateGroup = annotateGroup; } public String getTypeDescription() { return Arrays.toString(types); } public String toString() { return "Entry{" + ((tokensRegex != null) ? tokensRegex: StringUtils.join(regex)) + ' ' + StringUtils.join(types) + ' ' + overwritableTypes + " prio:" + priority + '}'; } } // end static class Entry
private static class Entry { public final String tokensRegex; public final String[] regex; // the regex, tokenized by splitting on white space public final String[] types; // the associated types public final Set<String> overwritableTypes; // what types can be overwritten by this entry public final double priority; public final double weight; public final int annotateGroup; public Entry(String tokensRegex, String[] regex, String[] types, Set<String> overwritableTypes, double priority, double weight, int annotateGroup) { this.tokensRegex = tokensRegex; this.regex = regex; this.types = new String[types.length]; for (int i = 0; i < types.length; i++) { // TODO: for some types, it doesn't make sense to be interning... this.types[i] = types[i].intern(); } this.overwritableTypes = overwritableTypes; this.priority = priority; this.weight = weight; this.annotateGroup = annotateGroup; } public String getTypeDescription() { return Arrays.toString(types); } public String toString() { return "Entry{" + ((tokensRegex != null) ? tokensRegex: StringUtils.join(regex)) + ' ' + StringUtils.join(types) + ' ' + overwritableTypes + " prio:" + priority + '}'; } } // end static class Entry