Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

How to Check wrong spelled words using SpellChecker programatically?

himasreep445197
Level 2
Level 2

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.

1 Accepted Solution
BrianKasingli
Correct answer by
Community Advisor
Community Advisor

@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/co...

I hope this helps,

Brian.

View solution in original post

1 Reply
BrianKasingli
Correct answer by
Community Advisor
Community Advisor

@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/co...

I hope this helps,

Brian.

View solution in original post