Skip to main content
Level 2
April 22, 2020
Solved

How to Check wrong spelled words using SpellChecker programatically?

  • April 22, 2020
  • 1 reply
  • 970 views

Hi,

My requirement is to get all the wrong spelled words from the text component of a  page programmatically. For this I have used SpellCheckerProvider.createSpellChecker(language, dictionarypaths[], resourceResolver);  to get SpellChecker, but I am not understanding what to give in the parameters i.e language and dictionary paths. Please help me in this. If you provide me any example of SpellCheckerProvider class, it would be more helpful.

 

Thanks in advance.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by BrianKasingli

@himasreep445197.

 

You can utilise the OSGI SpellCheckService, which can be easily understood is used.

@Reference private SpellCheckService spellchecker; WordCheckResult wordResult = spellchecker.checkText("hello world","eb-gb", false, null); boolean isCorrect = wordResult.isCorrect();

Documentation: https://helpx.adobe.com/experience-manager/6-2/sites/developing/using/reference-materials/javadoc/com/day/cq/spellchecker/SpellCheckService.html

I hope this helps,

Brian.

1 reply

BrianKasingli
Adobe Champion and Community Advisor
BrianKasingliAdobe Champion and Community AdvisorAccepted solution
Adobe Champion and Community Advisor
August 10, 2020

@himasreep445197.

 

You can utilise the OSGI SpellCheckService, which can be easily understood is used.

@Reference private SpellCheckService spellchecker; WordCheckResult wordResult = spellchecker.checkText("hello world","eb-gb", false, null); boolean isCorrect = wordResult.isCorrect();

Documentation: https://helpx.adobe.com/experience-manager/6-2/sites/developing/using/reference-materials/javadoc/com/day/cq/spellchecker/SpellCheckService.html

I hope this helps,

Brian.