title: Does any one know how to expand queries using Wordnet with Lucene 3.6?
body: <p>I've found the class <strong>WordnetSynonymParser</strong> in org.apache.lucene.analysis.synonym but there aren't examples of its usage neither in the API nor in google. Does any one have experience with it?</p>
  
  <p>Thank you!</p>
  
  <p><strong>EDIT</strong>: I know that there used to be the class <a href="https://stackoverflow.com/questions/1248039/synonyms-using-lucene">SynExpand</a>, but with version 3.6 it disappeared...</p>
  
  <p>I try:</p>
  
  <pre><code>           try {
                     FileReader rulesReader = new FileReader("wn/wn_s.pl");
                 SynonymMap.Builder parser = null;
                 parser = new WordnetSynonymParser(true, true, analyzer);
                 ((WordnetSynonymParser)parser).add(rulesReader);          
                 synonymMap = parser.build();
              } catch (Exception e) {
                              e.printStackTrace();
                              System.exit(1);
              }
  </code></pre>
  
  <p>But I get the following error:</p>
  
  <pre><code>java.text.ParseException: Invalid synonym rule at line 109
          at org.apache.lucene.analysis.synonym.WordnetSynonymParser.add(WordnetSynonymParser.java:75)
          at pirServer.QueryClassifier.&lt;init&gt;(QueryClassifier.java:77)
          at pirServer.PIRServer.main(PIRServer.java:32)
  Caused by: java.lang.IllegalArgumentException: term: course of action analyzed to a token with posinc != 1
          at org.apache.lucene.analysis.synonym.SynonymMap$Builder.analyze(SynonymMap.java:131)
          at org.apache.lucene.analysis.synonym.WordnetSynonymParser.parseSynonym(WordnetSynonymParser.java:92)
          at org.apache.lucene.analysis.synonym.WordnetSynonymParser.add(WordnetSynonymParser.java:67)
          ... 2 more 
  </code></pre>