4040import org .apache .lucene .analysis .tokenattributes .FlagsAttribute ;
4141import org .apache .lucene .analysis .tokenattributes .PositionIncrementAttribute ;
4242
43- import com .github .oeuvres .alix .common .Upos ;
4443import static com .github .oeuvres .alix .common .Upos .*;
4544
46- import com .github .oeuvres .alix .lucene .analysis .tokenattributes .LemAtt ;
47- import com .github .oeuvres .alix .lucene .analysis .tokenattributes .OrthAtt ;
4845import com .github .oeuvres .alix .util .Char ;
4946
5047/**
@@ -62,10 +59,6 @@ public class FilterCloud extends TokenFilter
6259 private final PositionIncrementAttribute posIncrAtt = addAttribute (PositionIncrementAttribute .class );
6360 /** A linguistic category as a short number, see {@link TagFr} */
6461 private final FlagsAttribute flagsAtt = addAttribute (FlagsAttribute .class );
65- /** A normalized orthographic form */
66- private final OrthAtt orthAtt = addAttribute (OrthAtt .class );
67- /** A lemma when possible */
68- private final LemAtt lemAtt = addAttribute (LemAtt .class );
6962 /** keep right position order */
7063 private int holes ;
7164
@@ -103,7 +96,7 @@ protected boolean skip()
10396 {
10497 final int flags = flagsAtt .getFlags ();
10598 // known word from dictionary, keep it
106- if (!lemAtt .isEmpty ()) return false ;
99+ // if (!lemAtt.isEmpty()) return false;
107100 // empty
108101 if (termAtt .isEmpty ()) return true ;
109102 // no position for XML between words M<sup>elle</sup>
@@ -131,9 +124,6 @@ protected boolean skip()
131124 protected boolean accept ()
132125 {
133126 final int flags = flagsAtt .getFlags ();
134- if (flags == TEST .code ) {
135- System .out .println (termAtt + " — " + orthAtt );
136- }
137127 // record an empty token at puctuation position for the rails
138128 if (PUNCT .isPunct (flags )) {
139129 if (flags == PUNCTclause .code ) {
@@ -155,8 +145,8 @@ else if (flags == PUNCTpara.code || flags == PUNCTsection.code) {
155145 }
156146
157147 // do not keep flexion on substantives, no semantic gain
158- if (!lemAtt .isEmpty ()) termAtt .setEmpty ().append (lemAtt );
159- else if (!orthAtt .isEmpty ()) termAtt .setEmpty ().append (orthAtt );
148+ // if (!lemAtt.isEmpty()) termAtt.setEmpty().append(lemAtt);
149+ // else if (!orthAtt.isEmpty()) termAtt.setEmpty().append(orthAtt);
160150 // no more suffix
161151 return true ;
162152 }
0 commit comments