Java Code Examples for org.apache.lucene.util.AttributeReflector#reflect()

The following examples show how to use org.apache.lucene.util.AttributeReflector#reflect() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ReadingAttributeImpl.java    From lucene-solr with Apache License 2.0 5 votes vote down vote up
@Override
public void reflectWith(AttributeReflector reflector) {
  String reading = getReading();
  String readingEN = reading == null ? null : ToStringUtil.getRomanization(reading);
  String pronunciation = getPronunciation();
  String pronunciationEN = pronunciation == null ? null : ToStringUtil.getRomanization(pronunciation);
  reflector.reflect(ReadingAttribute.class, "reading", reading);
  reflector.reflect(ReadingAttribute.class, "reading (en)", readingEN);
  reflector.reflect(ReadingAttribute.class, "pronunciation", pronunciation);
  reflector.reflect(ReadingAttribute.class, "pronunciation (en)", pronunciationEN);
}
 
Example 2
Source File: InflectionAttributeImpl.java    From lucene-solr with Apache License 2.0 5 votes vote down vote up
@Override
public void reflectWith(AttributeReflector reflector) {
  String type = getInflectionType();
  String typeEN = type == null ? null : ToStringUtil.getInflectionTypeTranslation(type);
  reflector.reflect(InflectionAttribute.class, "inflectionType", type);
  reflector.reflect(InflectionAttribute.class, "inflectionType (en)", typeEN);
  String form = getInflectionForm();
  String formEN = form == null ? null : ToStringUtil.getInflectedFormTranslation(form);
  reflector.reflect(InflectionAttribute.class, "inflectionForm", form);
  reflector.reflect(InflectionAttribute.class, "inflectionForm (en)", formEN);
}
 
Example 3
Source File: ScriptAttributeImpl.java    From lucene-solr with Apache License 2.0 5 votes vote down vote up
@Override
public void reflectWith(AttributeReflector reflector) {
  // when wordbreaking CJK, we use the 15924 code Japanese (Han+Hiragana+Katakana) to 
  // mark runs of Chinese/Japanese. our use is correct (as for chinese Han is a subset), 
  // but this is just to help prevent confusion.
  String name = code == UScript.JAPANESE ? "Chinese/Japanese" : getName();
  reflector.reflect(ScriptAttribute.class, "script", name);
}
 
Example 4
Source File: PartOfSpeechAttributeImpl.java    From lucene-solr with Apache License 2.0 5 votes vote down vote up
@Override
public void reflectWith(AttributeReflector reflector) {
  String posName = getPOSType() == null ? null : getPOSType().name();
  String rightPOS = getRightPOS() == null ? null : getRightPOS().name() + "(" + getRightPOS().description() + ")";
  String leftPOS = getLeftPOS() == null ? null : getLeftPOS().name() + "(" + getLeftPOS().description() + ")";
  reflector.reflect(PartOfSpeechAttribute.class, "posType", posName);
  reflector.reflect(PartOfSpeechAttribute.class, "leftPOS", leftPOS);
  reflector.reflect(PartOfSpeechAttribute.class, "rightPOS", rightPOS);
  reflector.reflect(PartOfSpeechAttribute.class, "morphemes", displayMorphemes(getMorphemes()));
}
 
Example 5
Source File: LegacyNumericTokenStream.java    From lucene-solr with Apache License 2.0 5 votes vote down vote up
@Override
public void reflectWith(AttributeReflector reflector) {
  reflector.reflect(TermToBytesRefAttribute.class, "bytes", getBytesRef());
  reflector.reflect(LegacyNumericTermAttribute.class, "shift", shift);
  reflector.reflect(LegacyNumericTermAttribute.class, "rawValue", getRawValue());
  reflector.reflect(LegacyNumericTermAttribute.class, "valueSize", valueSize);
}
 
Example 6
Source File: ConcatenateGraphFilter.java    From lucene-solr with Apache License 2.0 4 votes vote down vote up
@Override
public void reflectWith(AttributeReflector reflector) {
  reflector.reflect(TermToBytesRefAttribute.class, "bytes", getBytesRef());
}
 
Example 7
Source File: FlagsAttributeImpl.java    From lucene-solr with Apache License 2.0 4 votes vote down vote up
@Override
public void reflectWith(AttributeReflector reflector) {
  reflector.reflect(FlagsAttribute.class, "flags", flags);
}
 
Example 8
Source File: TaggingAttributeImpl.java    From lucene-solr with Apache License 2.0 4 votes vote down vote up
@Override
public void reflectWith(AttributeReflector reflector) {
  reflector.reflect(TaggingAttribute.class, "taggable", isTaggable());
}
 
Example 9
Source File: BoostAttributeImpl.java    From lucene-solr with Apache License 2.0 4 votes vote down vote up
@Override
public void reflectWith(AttributeReflector reflector) {
  reflector.reflect(BoostAttribute.class, "boost", boost);
}
 
Example 10
Source File: PayloadAttributeImpl.java    From lucene-solr with Apache License 2.0 4 votes vote down vote up
@Override
public void reflectWith(AttributeReflector reflector) {
  reflector.reflect(PayloadAttribute.class, "payload", payload);
}
 
Example 11
Source File: UniqueFieldAttributeImpl.java    From lucene-solr with Apache License 2.0 4 votes vote down vote up
@Override
public void reflectWith(AttributeReflector reflector) {
  reflector.reflect(UniqueFieldAttribute.class, "uniqueField", uniqueField);
}
 
Example 12
Source File: Token.java    From lucene-solr with Apache License 2.0 4 votes vote down vote up
@Override
public void reflectWith(AttributeReflector reflector) {
  super.reflectWith(reflector);
  reflector.reflect(FlagsAttribute.class, "flags", flags);
  reflector.reflect(PayloadAttribute.class, "payload", payload);
}
 
Example 13
Source File: BaseTokenStreamTestCase.java    From lucene-solr with Apache License 2.0 4 votes vote down vote up
@Override
public void reflectWith(AttributeReflector reflector) {
  reflector.reflect(CheckClearAttributesAttribute.class, "clearCalled", clearCalled);
}
 
Example 14
Source File: BaseTermVectorsFormatTestCase.java    From lucene-solr with Apache License 2.0 4 votes vote down vote up
@Override
public void reflectWith(AttributeReflector reflector) {
  reflector.reflect(OffsetAttribute.class, "startOffset", start);
  reflector.reflect(OffsetAttribute.class, "endOffset", end);
}
 
Example 15
Source File: BytesTermAttributeImpl.java    From lucene-solr with Apache License 2.0 4 votes vote down vote up
@Override
public void reflectWith(AttributeReflector reflector) {
  reflector.reflect(TermToBytesRefAttribute.class, "bytes", bytes);
}
 
Example 16
Source File: MorphosyntacticTagsAttributeImpl.java    From lucene-solr with Apache License 2.0 4 votes vote down vote up
@Override
public void reflectWith(AttributeReflector reflector) {
  reflector.reflect(MorphosyntacticTagsAttribute.class, "tags", tags);
}
 
Example 17
Source File: TypeAttributeImpl.java    From lucene-solr with Apache License 2.0 4 votes vote down vote up
@Override
public void reflectWith(AttributeReflector reflector) {
  reflector.reflect(TypeAttribute.class, "type", type);
}
 
Example 18
Source File: CharTermAttributeImpl.java    From lucene-solr with Apache License 2.0 4 votes vote down vote up
@Override
public void reflectWith(AttributeReflector reflector) {
  reflector.reflect(CharTermAttribute.class, "term", toString());
  reflector.reflect(TermToBytesRefAttribute.class, "bytes", getBytesRef());
}
 
Example 19
Source File: PositionIncrementAttributeImpl.java    From lucene-solr with Apache License 2.0 4 votes vote down vote up
@Override
public void reflectWith(AttributeReflector reflector) {
  reflector.reflect(PositionIncrementAttribute.class, "positionIncrement", positionIncrement);
}
 
Example 20
Source File: TokenizedFieldsAttributeImpl.java    From datawave with Apache License 2.0 4 votes vote down vote up
@Override
public void reflectWith(AttributeReflector reflector) {
    reflector.reflect(TokenizedFieldsAttribute.class, "tokenizedFields", getTokenizedFields());
    reflector.reflect(TokenizedFieldsAttribute.class, "tokenizeUnfieldedQueriesEnabled", isTokenizeUnfieldedQueriesEnabled());
    reflector.reflect(TokenizedFieldsAttribute.class, "skipTokenizeUnfieldedFields", getSkipTokenizeUnfieldedFields());
}