private AndSegmentItem createAndSegment(BlockItem current) { return new AndSegmentItem(current.stringValue(), true, true); }
private CompositeItem phraseSegment(BlockItem current, String indexName) { CompositeItem composite; composite = new PhraseSegmentItem(current.getRawWord(), current.stringValue(), true, true); composite.setIndexName(indexName); return composite; }
BlockItem blockDeletionCandidate = (BlockItem) deleteCandidate; BlockItem blockToCheck = (BlockItem) check; if (blockDeletionCandidate.stringValue().equals(blockToCheck.stringValue())) { composite.removeItem(i); break;
private TaggableItem singleWordSegment(BlockItem current, StemList segment, Index index, Substring substring, boolean insidePhrase) { String indexName = current.getIndexName(); if (insidePhrase == false && ((index.getLiteralBoost() || index.getStemMode() == StemMode.ALL))) { List<Alternative> terms = new ArrayList<>(segment.size() + 1); terms.add(new Alternative(current.stringValue(), 1.0d)); for (String term : segment) { terms.add(new Alternative(term, 0.7d)); } WordAlternativesItem alternatives = new WordAlternativesItem(indexName, current.isFromQuery(), substring, terms); if (alternatives.getAlternatives().size() > 1) { return alternatives; } } WordItem first = singleStemSegment((Item) current, segment.get(0), indexName, substring); return first; }
private Item stem(BlockItem current, StemContext context, Index index) { Item blockAsItem = (Item)current; CompositeItem composite; List<StemList> segments = linguistics.getStemmer().stem(current.stringValue(), index.getStemMode(), context.language); String indexName = current.getIndexName(); Substring substring = getOffsets(current);