private void addAttributes(TokenStream tokenStream) { tokenStream.addAttribute(OffsetAttribute.class); tokenStream.addAttribute(ReadingAttribute.class); tokenStream.addAttribute(PartOfSpeechAttribute.class); tokenStream.addAttribute(InflectionAttribute.class); tokenStream.addAttribute(BaseFormAttribute.class); }
private void readReading(TokenStream tokenStream, LuceneToken token) { ReadingAttribute reading = tokenStream .getAttribute(ReadingAttribute.class); if (reading != null) { token.setPronunciation(reading.getPronunciation()); token.setReading(reading.getReading()); } }