0

I am new to Lucene. I am trying to have custom attributes to tokens. I was able to get the attributes assigned to tokens. However I realise that we need to roughly have 3 files (Interface Class extending Attribute , Class extending AttributeImpl and a Class extending TokenFilter) for each of my Attribute?

I might have about 50 attributes that I need to assign. Do I have to have 3 files per Attribute? that is about 150 files.

Or is there some way I can reduce that. I am sure there is something that I am not able to find.

Help is greatly appreciated.

4

1 回答 1

0

您不需要与令牌“类型”一样多的属性。您所需要的只是一个属性,该属性具有一个告诉您的令牌是什么的成员。您可以重用或从 Lucene 的 TypeAttribute 中获得一些灵感。

于 2013-05-20T12:13:42.200 回答