- public RowMatchType matches(final List<String> searchTokens, final Pattern orderedMatchPattern, final Transliterator normalizer, final boolean swapPairEntries) {
- final String text = normalizer.transform(getRawText(false));
- if (orderedMatchPattern.matcher(text).find()) {
- return RowMatchType.ORDERED_MATCH;
- }
- for (int i = searchTokens.size() - 1; i >= 0; --i) {
- final String searchToken = searchTokens.get(i);
- if (!text.contains(searchToken)) {
- return RowMatchType.NO_MATCH;
+ public String toString() {
+ return getRawText(false);
+ }
+
+ // --------------------------------------------------------------------
+
+ public static class Row extends RowBase {
+
+ Row(final DataInput raf, final int thisRowIndex,
+ final Index index, int extra) throws IOException {
+ super(raf, thisRowIndex, index, extra);
+ }
+
+ Row(final int referenceIndex, final int thisRowIndex,
+ final Index index) {
+ super(referenceIndex, thisRowIndex, index);
+ }
+
+ @Override
+ public String toString() {
+ return getRawText(false);
+ }
+
+ public HtmlEntry getEntry() {
+ return index.dict.htmlEntries.get(referenceIndex);
+ }
+
+ @Override
+ public void print(PrintStream out) {
+ final HtmlEntry entry = getEntry();
+ out.println("See also HtmlEntry:" + entry.title);
+ }
+
+ @Override
+ public String getRawText(boolean compact) {
+ final HtmlEntry entry = getEntry();
+ return entry.getRawText(compact);
+ }
+
+ @Override
+ public RowMatchType matches(final List<String> searchTokens,
+ final Pattern orderedMatchPattern, final Transliterator normalizer,
+ final boolean swapPairEntries) {
+ final String text = normalizer.transform(getRawText(false));
+ if (orderedMatchPattern.matcher(text).find()) {
+ return RowMatchType.ORDERED_MATCH;
+ }
+ for (int i = searchTokens.size() - 1; i >= 0; --i) {
+ final String searchToken = searchTokens.get(i);
+ if (!text.contains(searchToken)) {
+ return RowMatchType.NO_MATCH;
+ }
+ }
+ return RowMatchType.BAG_OF_WORDS_MATCH;