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

How to Check wrong spelled words using SpellChecker programatically?

Avatar

Avatar
Ignite 5
Level 2
himasreep445197
Level 2

Likes

4 likes

Total Posts

12 posts

Correct Reply

0 solutions
Top badges earned
Ignite 5
Ignite 3
Ignite 1
Give Back 3
Give Back
View profile

Avatar
Ignite 5
Level 2
himasreep445197
Level 2

Likes

4 likes

Total Posts

12 posts

Correct Reply

0 solutions
Top badges earned
Ignite 5
Ignite 3
Ignite 1
Give Back 3
Give Back
View profile
himasreep445197
Level 2

21-04-2020

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.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
MVP
BrianKasingli
MVP

Likes

644 likes

Total Posts

605 posts

Correct Reply

239 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile

Avatar
Establish
MVP
BrianKasingli
MVP

Likes

644 likes

Total Posts

605 posts

Correct Reply

239 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile
BrianKasingli
MVP

10-08-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/co...

I hope this helps,

Brian.

Answers (0)