[
https://issues.apache.org/jira/browse/LUCENE-7971?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16168899#comment-16168899
]
ASF GitHub Bot commented on LUCENE-7971:
----------------------------------------
GitHub user sarxos opened a pull request:
https://github.com/apache/lucene-solr/pull/248
Fix invalid javadoc example in SpellChecker
Hello Lucene team.
This pull request is to address
[LUCENE-7971](https://issues.apache.org/jira/browse/LUCENE-7971) bug from JIRA.
It is a fix for invalid example in ```SpellChecker``` javadoc. Index
dictionary can be done by invoking ```checker.indexDictionary(dictionary,
config, true)``` but in javadoc example the
```checker.indexDictionary(dictionary)``` method is used instead, which is
wrong, because such method does not exist.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/sarxos/lucene-solr patch-1
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/lucene-solr/pull/248.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #248
----
commit 5d132c5cdd57f5ade3c7f09b92eb653667775413
Author: Bartosz Firyn <[email protected]>
Date: 2017-09-16T11:52:55Z
Fix invalid javadoc example in SpellChecker
This is fix for invalid example in SpellChecker javadoc. Index dictionary
can be done by invoking SpellChecker::indexDictionary(Dictionary,
IndexWriterConfig, boolean), but in javadoc example the
SpellChecker::indexDictionary(Dictionary) method is used instead, which is
wrong because such method does not exist.
----
> Invalid example in SpellChecker javadoc
> ---------------------------------------
>
> Key: LUCENE-7971
> URL: https://issues.apache.org/jira/browse/LUCENE-7971
> Project: Lucene - Core
> Issue Type: Bug
> Components: modules/suggest
> Affects Versions: 6.6.1
> Reporter: Bartosz Firyn
> Priority: Trivial
> Original Estimate: 0.25h
> Remaining Estimate: 0.25h
>
> Hello, in Lucene javadoc for SpellChecker class there is an example of how to
> use it, however it's incorrect (wrong method signature).
> File: lucene/suggest/src/java/org/apache/lucene/search/spell/SpellChecker.java
> It should be:
> {code:java}
> SpellChecker spellchecker = new SpellChecker(spellIndexDirectory);
> IndexWriterConfig config = new IndexWriterConfig();
> spellchecker.indexDictionary(new LuceneDictionary(my_lucene_reader, a_field),
> config, true);
> spellchecker.indexDictionary(new PlainTextDictionary(new File("myfile.txt")),
> config, true);
> String[] suggestions = spellchecker.suggestSimilar("misspelt", 5);
> {code}
> Instead of:
> {code:java}
> SpellChecker spellchecker = new SpellChecker(spellIndexDirectory);
> spellchecker.indexDictionary(new LuceneDictionary(my_lucene_reader, a_field));
> spellchecker.indexDictionary(new PlainTextDictionary(new File("myfile.txt")));
> String[] suggestions = spellchecker.suggestSimilar("misspelt", 5);
> {code}
> I'm in the middle of sending pull request on Github. Just wanted to create
> JIRA ticket so I can reference it in my pull request.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]