/** * Sets attributeSource to a new instance. */ void setAttributeSource(AttributeSource attributeSource) { if (this.attributeSource != attributeSource) { this.attributeSource = attributeSource; termAttribute = attributeSource.getAttribute(TermToBytesRefAttribute.class); termFreqAttribute = attributeSource.addAttribute(TermFrequencyAttribute.class); posIncrAttribute = attributeSource.addAttribute(PositionIncrementAttribute.class); offsetAttribute = attributeSource.addAttribute(OffsetAttribute.class); payloadAttribute = attributeSource.getAttribute(PayloadAttribute.class); } }
public InputWindowToken(AttributeSource attSource) { this.attSource = attSource; this.termAtt = attSource.getAttribute(CharTermAttribute.class); this.offsetAtt = attSource.getAttribute(OffsetAttribute.class); } }
public InputWindowToken(AttributeSource attSource) { this.attSource = attSource; this.termAtt = attSource.getAttribute(CharTermAttribute.class); this.offsetAtt = attSource.getAttribute(OffsetAttribute.class); } }
public InputWindowToken(AttributeSource attSource) { this.attSource = attSource; this.termAtt = attSource.getAttribute(CharTermAttribute.class); this.offsetAtt = attSource.getAttribute(OffsetAttribute.class); } }
public InputWindowToken(AttributeSource attSource) { this.attSource = attSource; this.termAtt = attSource.getAttribute(CharTermAttribute.class); this.offsetAtt = attSource.getAttribute(OffsetAttribute.class); } }
/** * Sets attributeSource to a new instance. */ void setAttributeSource(AttributeSource attributeSource) { if (this.attributeSource != attributeSource) { this.attributeSource = attributeSource; termAttribute = attributeSource.getAttribute(TermToBytesRefAttribute.class); posIncrAttribute = attributeSource.addAttribute(PositionIncrementAttribute.class); offsetAttribute = attributeSource.addAttribute(OffsetAttribute.class); payloadAttribute = attributeSource.getAttribute(PayloadAttribute.class); } }
/** * Sets attributeSource to a new instance. */ void setAttributeSource(AttributeSource attributeSource) { if (this.attributeSource != attributeSource) { this.attributeSource = attributeSource; termAttribute = attributeSource.getAttribute(TermToBytesRefAttribute.class); posIncrAttribute = attributeSource.addAttribute(PositionIncrementAttribute.class); offsetAttribute = attributeSource.addAttribute(OffsetAttribute.class); payloadAttribute = attributeSource.getAttribute(PayloadAttribute.class); } }
/** * Sets attributeSource to a new instance. */ void setAttributeSource(AttributeSource attributeSource) { if (this.attributeSource != attributeSource) { this.attributeSource = attributeSource; termAttribute = attributeSource.getAttribute(TermToBytesRefAttribute.class); termFreqAttribute = attributeSource.addAttribute(TermFrequencyAttribute.class); posIncrAttribute = attributeSource.addAttribute(PositionIncrementAttribute.class); offsetAttribute = attributeSource.addAttribute(OffsetAttribute.class); payloadAttribute = attributeSource.getAttribute(PayloadAttribute.class); } }
private void handleTerm(SortedMap<String, Lumongo.Term.Builder> termsMap, TermsEnum termsEnum, BytesRef text, Pattern termFilter, Pattern termMatch) throws IOException { String textStr = text.utf8ToString(); if (termFilter != null || termMatch != null) { if (termFilter != null) { if (termFilter.matcher(textStr).matches()) { return; } } if (termMatch != null) { if (!termMatch.matcher(textStr).matches()) { return; } } } if (!termsMap.containsKey(textStr)) { termsMap.put(textStr, Lumongo.Term.newBuilder().setValue(textStr).setDocFreq(0).setTermFreq(0)); } Lumongo.Term.Builder builder = termsMap.get(textStr); builder.setDocFreq(builder.getDocFreq() + termsEnum.docFreq()); builder.setTermFreq(builder.getTermFreq() + termsEnum.totalTermFreq()); BoostAttribute boostAttribute = termsEnum.attributes().getAttribute(BoostAttribute.class); if (boostAttribute != null) { builder.setScore(boostAttribute.getBoost()); } }
clonedTermAtt = clonedToken.getAttribute(CharTermAttribute.class); clonedOffsetAtt = clonedToken.getAttribute(OffsetAttribute.class); } else { this.copyTo(clonedToken);
clonedTermAtt = clonedToken.getAttribute(CharTermAttribute.class); clonedOffsetAtt = clonedToken.getAttribute(OffsetAttribute.class); } else { this.copyTo(clonedToken);
clonedTermAtt = clonedToken.getAttribute(CharTermAttribute.class); clonedOffsetAtt = clonedToken.getAttribute(OffsetAttribute.class); } else { this.copyTo(clonedToken);