Spellchecker API is not working | Community
Skip to main content
Level 2
April 23, 2020
Question

Spellchecker API is not working

  • April 23, 2020
  • 1 reply
  • 2291 views

Hi,

 

I used below code to perform spell check operation.

 

String[] dictionaryPaths = {"C:\\aem\\en_us.dic","C:\\aem\\en_us.aff"};

SpellChecker spellChecker = spellCheckerProvider.createSpellChecker("English",dictionaryPaths,resourceResolver);

 

But it giving exception like 

com.day.cq.spellchecker.SpellCheckException: No suitable dictionary found for language 'english'.

 

Can anyone please help me what is the parameter i need to give for language. I tried with en, en_us. No use with that also.

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.

1 reply

Nikhil-Kumar
Community Advisor
Community Advisor
November 22, 2024

@nivesh_j  - 

1. Validate the Dictionary Files

  • Ensure that the dictionary files (.dic and .aff) are correctly formatted and valid.
  • These files should comply with the Hunspell dictionary format.

2. Place Dictionary Files in an Accessible Location

  • Instead of providing absolute paths, place the dictionary files in a directory accessible by the AEM instance.
  • For example, upload them to the AEM DAM or include them as part of your project in a known path (/apps/<project>/dictionaries).

3. Update the Dictionary Path

  • Use the JCR repository or an accessible file system path for the dictionary paths.
  • Example:
    java
    String[] dictionaryPaths = {
    "/apps/myproject/dictionaries/en_us.dic", "/apps/myproject/dictionaries/en_us.aff" };