Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9AF8FD707 for ; Wed, 17 Oct 2012 12:30:06 +0000 (UTC) Received: (qmail 50010 invoked by uid 500); 17 Oct 2012 12:30:03 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 49888 invoked by uid 500); 17 Oct 2012 12:30:03 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 49852 invoked by uid 99); 17 Oct 2012 12:30:03 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Oct 2012 12:30:03 +0000 Date: Wed, 17 Oct 2012 12:30:03 +0000 (UTC) From: "Anthony Mckale (JIRA)" To: dev@lucene.apache.org Message-ID: <1389415116.57241.1350477003289.JavaMail.jiratomcat@arcas> In-Reply-To: <1138987503.57235.1350476883225.JavaMail.jiratomcat@arcas> Subject: [jira] [Updated] (LUCENE-4487) SpellChecker : SpellChecker.indexDictionary : Javadoc incorrect MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LUCENE-4487?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Anthony Mckale updated LUCENE-4487: ----------------------------------- Description: example code in javadoc seems to be incorrect code changes from LUCENE-3557 means the javadoc {code} SpellChecker spellchecker = new SpellChecker(spellIndexDirectory); // To index a field of a user index: spellchecker.indexDictionary(new LuceneDictionary(my_lucene_reader, a_field)); // To index a file containing words: spellchecker.indexDictionary(new PlainTextDictionary(new File("myfile.txt"))); String[] suggestions = spellchecker.suggestSimilar("misspelt", 5); {code} is incorrect i think something like this is better maybe {code} SpellChecker spellchecker = new SpellChecker(spellIndexDirectory); // To index a field of a user index: spellchecker.indexDictionary(new LuceneDictionary(my_lucene_reader, a_field), new IndexWriterConfig(Version.LUCENE_CURRENT, null), false); // To index a file containing words: spellchecker.indexDictionary(new PlainTextDictionary(new File("myfile.txt")), new IndexWriterConfig(Version.LUCENE_CURRENT, null), false); String[] suggestions = spellchecker.suggestSimilar("misspelt", 5); {code} I'd possibly add something about creating a spellIndexDirectory too, not clear {code} Directory spellIndexDirectory = FSDirectory.open("/dev/tmp/SOME_WORKING_DIR"); SpellChecker spellchecker = new SpellChecker(spellIndexDirectory); // To index a field of a user index: spellchecker.indexDictionary(new LuceneDictionary(my_lucene_reader, a_field), new IndexWriterConfig(Version.LUCENE_CURRENT, null), false); // To index a file containing words: spellchecker.indexDictionary(new PlainTextDictionary(new File("myfile.txt")), new IndexWriterConfig(Version.LUCENE_CURRENT, null), false); String[] suggestions = spellchecker.suggestSimilar("misspelt", 5); {code} would of sent a patch but not familiar with how to get access to the apache git repo todo a pull/push cheers Ant was: example code in javadoc seems to be incorrect code changes from LUCENE-3557 means the javadoc {code} SpellChecker spellchecker = new SpellChecker(spellIndexDirectory); // To index a field of a user index: spellchecker.indexDictionary(new LuceneDictionary(my_lucene_reader, a_field)); // To index a file containing words: spellchecker.indexDictionary(new PlainTextDictionary(new File("myfile.txt"))); String[] suggestions = spellchecker.suggestSimilar("misspelt", 5); {code} is incorrect i think something like this is better maybe {code} SpellChecker spellchecker = new SpellChecker(spellIndexDirectory); // To index a field of a user index: spellchecker.indexDictionary(new LuceneDictionary(my_lucene_reader, a_field), new IndexWriterConfig(Version.LUCENE_CURRENT, null), false); // To index a file containing words: spellchecker.indexDictionary(new PlainTextDictionary(new File("myfile.txt")), new IndexWriterConfig(Version.LUCENE_CURRENT, null), false); String[] suggestions = spellchecker.suggestSimilar("misspelt", 5); {code} I'd possibly add something about creating a spellIndexDirectory too, not clear {code} Directory spellIndexDirectory = FSDirectory.open("/dev/tmp/SOME_WORKING_DIR"); SpellChecker spellchecker = new SpellChecker(spellIndexDirectory); // To index a field of a user index: spellchecker.indexDictionary(new LuceneDictionary(my_lucene_reader, a_field), new IndexWriterConfig(Version.LUCENE_CURRENT, null), false); // To index a file containing words: spellchecker.indexDictionary(new PlainTextDictionary(new File("myfile.txt")), new IndexWriterConfig(Version.LUCENE_CURRENT, null), false); String[] suggestions = spellchecker.suggestSimilar("misspelt", 5); {code} would of sent a patch but not familiar with how to get access to the apache git repo do a pull/push cheers Ant > SpellChecker : SpellChecker.indexDictionary : Javadoc incorrect > --------------------------------------------------------------- > > Key: LUCENE-4487 > URL: https://issues.apache.org/jira/browse/LUCENE-4487 > Project: Lucene - Core > Issue Type: Improvement > Components: modules/spellchecker > Affects Versions: 3.6.1 > Reporter: Anthony Mckale > Priority: Minor > > example code in javadoc seems to be incorrect > code changes from LUCENE-3557 > means the javadoc > {code} > SpellChecker spellchecker = new SpellChecker(spellIndexDirectory); > // To index a field of a user index: > spellchecker.indexDictionary(new LuceneDictionary(my_lucene_reader, a_field)); > // To index a file containing words: > spellchecker.indexDictionary(new PlainTextDictionary(new File("myfile.txt"))); > String[] suggestions = spellchecker.suggestSimilar("misspelt", 5); > {code} > is incorrect i think something like this is better maybe > {code} > SpellChecker spellchecker = new SpellChecker(spellIndexDirectory); > // To index a field of a user index: > spellchecker.indexDictionary(new LuceneDictionary(my_lucene_reader, a_field), new IndexWriterConfig(Version.LUCENE_CURRENT, null), false); > // To index a file containing words: > spellchecker.indexDictionary(new PlainTextDictionary(new File("myfile.txt")), new IndexWriterConfig(Version.LUCENE_CURRENT, null), false); > String[] suggestions = spellchecker.suggestSimilar("misspelt", 5); > {code} > I'd possibly add something about creating a spellIndexDirectory too, not clear > {code} > Directory spellIndexDirectory = FSDirectory.open("/dev/tmp/SOME_WORKING_DIR"); > SpellChecker spellchecker = new SpellChecker(spellIndexDirectory); > // To index a field of a user index: > spellchecker.indexDictionary(new LuceneDictionary(my_lucene_reader, a_field), new IndexWriterConfig(Version.LUCENE_CURRENT, null), false); > // To index a file containing words: > spellchecker.indexDictionary(new PlainTextDictionary(new File("myfile.txt")), new IndexWriterConfig(Version.LUCENE_CURRENT, null), false); > String[] suggestions = spellchecker.suggestSimilar("misspelt", 5); > {code} > would of sent a patch but not familiar with how to get access to the apache git repo todo a pull/push > cheers > Ant -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org