OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.34k stars 2.37k forks source link

Implement Lucene Spell Checker #3199

Open Skrypt opened 5 years ago

Skrypt commented 5 years ago

https://lucenenet.apache.org/docs/3.0.3/d2/dc5/class_spell_checker_1_1_net_1_1_search_1_1_spell_1_1_spell_checker.html

Example Usage:

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);
sebastienros commented 5 years ago

https://github.com/apache/lucenenet/blob/master/src/Lucene.Net.Suggest/Spell/SpellChecker.cs

sebastienros commented 3 years ago

This would be available as a web api endpoint to suggest terms based on the content of an index. Could then be use in custom search uis. Has to be provided as a custom feature.

Skrypt commented 3 years ago

based on the content of an index

Per index. As spellchecking needs to be specific from a culture to an other most of the time.