lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cszjf <>
Subject Using wordnet synonyms to expand a query in Lucene 4.10 version
Date Wed, 05 Nov 2014 09:19:59 GMT
I am using Lucene 4.10 and would like to know how wordnet can be used to
expand an input query for this version of Lucene. the program fragment is as
*File file = new File("model/");
InputStream stream = new FileInputStream(file);
Reader rulesReader = new InputStreamReader(stream); 
SynonymMap.Builder parser = null;
parser = new WordnetSynonymParser(true, true, new ClassicAnalyzer());
((WordnetSynonymParser) parser).parse(rulesReader);         
SynonymMap synonymMap =;*
the following exception will be produced when running the program
*java.text.ParseException:Invalid synonym rule line 109.*
I have searched much materials in google, but i have not resolve this
exception.  I want to know how to use the WordNetSynonymParser, Can you
paste a sample code for me? thank you.

View this message in context:
Sent from the Lucene - Java Developer mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message