Page 1 of 1

Can we edit the dictionary which are pre exist

Posted: Tue Oct 18, 2022 7:48 am
by shikhar_472
Can we edit the dictionary which is pre exist in dict folder as it is getting auto loaded while re starting the server attaching the image for reference.
Also is it possible to use other dictionary which has some other extension like (.ENG)
image.png

Re: Can we edit the dictionary which are pre exist

Posted: Thu Oct 27, 2022 7:00 am
by shikhar_472
Hi Team,
Is there any update on this.
Also as per our requirement we are replacing one the the pre existing editor with oxygen web author so there we are using the dictionary by microsoft which contains .lex file is there any way we can use those dictionary file as part of custom spell check functionality.
Or we can convert .lex file to .dic file

Thanks,
Shikhar.

Re: Can we edit the dictionary which are pre exist

Posted: Thu Oct 27, 2022 12:33 pm
by cristi_talau
Hello,

Sorry for the late reply.

You are right - if you delete one of the ".dic" files it will be copied over again when the server restarts. You can workaround this issue by deleting the ".dic" files from the source JAR (located in "tomcat\webapps\oxygen-xml-web-author\WEB-INF\lib\dicts-hunspell.jar".
However, most of our clients that want to customize spellchecking use custom terms lists or custom dictionaries .

For more advanced use-cases, we have a spell-checker API that you can implement in an editor plugin.

Regarding the LEX format, it is not supported and we are not aware of any tool that converts this format to the "dic" format (supported by Hunspell). If you find such a tool, it would be great to update this forum thread to let other users know.

Best,
Cristian

Re: Can we edit the dictionary which are pre exist

Posted: Thu Nov 03, 2022 11:12 am
by shikhar_472
Thanks Critian,

I want to set the terms dictionary document specific but using this API same dictionary is getting used for other document as well,
Could you please suggest the way to do that.

Thanks,
Shikhar.

Re: Can we edit the dictionary which are pre exist

Posted: Thu Nov 03, 2022 2:38 pm
by cristi_talau
Hello,

Your code should look like this:

Code: Select all

authorDocumentModel.getSpellchecker().setTermsDictionary(...)
In this case, the dictionary is set only for the current document. Do you experience a different behavior?

Best,
Cristian

Re: Can we edit the dictionary which are pre exist

Posted: Fri Nov 04, 2022 9:12 am
by shikhar_472
Hi Cristi,

I have opened a document using one URL and set the word to the custom dictionary "Eitenmiller" so this word is not throwing error here -

http://localhost:8084/oxygen-xml-web-au ... /Document1


Now i have opened the second document using the same URL on different tab "Eitenmiller" here also error is gone for this word-

http://localhost:8084/oxygen-xml-web-au ... /Document2

Requirement-- for the second URL error should not gone for the word "Eitenmiller" terms dictionary which has been set for document1 should not reflect in document2.

Thanks,
Shikhar.

Re: Can we edit the dictionary which are pre exist

Posted: Fri Nov 04, 2022 10:24 am
by cristi_talau
Hello,

I do not fully understand the context of your problem:
  • Did you implement your own plugin?
Your requirement is only possible if you implement our own plugin using the API that I described in a previous post.

Best,
Cristian

Re: Can we edit the dictionary which are pre exist

Posted: Fri Nov 04, 2022 11:43 am
by shikhar_472
Yes,
we are using our own custom plugin using similar implementation to learn word plugin,
spellchecker.setTermsDictionary(apiDict);

We are setting apiDict on load of the document at EDITOR_LOADED event.

Our use case is to load different custom dictionary(apiDict) for each document.

Also i want to achieve this in web author as we are using webdav URL to load the document

Thanks,
Shikhar.

Re: Can we edit the dictionary which are pre exist

Posted: Fri Nov 04, 2022 6:09 pm
by cristi_talau
Hello,

So, you say that the API is behaving unexpectedly? If yes, can you share with us a simple plugin that manifests the problematic behavior?

Best,
Cristian

Re: Can we edit the dictionary which are pre exist

Posted: Mon Nov 07, 2022 2:15 pm
by shikhar_472
content-plugin.zip
Hi Critian,

Please find the attached plugin i am using.

Thanks,
Shikhar.

Re: Can we edit the dictionary which are pre exist

Posted: Tue Nov 08, 2022 1:59 pm
by mihaela
Hi,

We tested your plugin and the problem that you encountered is produced by the fact that you use class fields in AddToDictionary operation. The value of "readAllWords" is reused between editors because there is a single instance of AddToDictionary operation that is used for all editors, not one per editor.
Please let us know if you encounter any other problems.

Best Regards,
Mihaela.

Re: Can we edit the dictionary which are pre exist

Posted: Thu Nov 10, 2022 8:29 am
by shikhar_472
Hi Miheala,
How can we seprate the dictionary for each editor.
Is there any way to do that.
Also is there any method where we can get the document ID so we can update the dictionary on the basis of doc Id in map.

Thanks,
Shikhar.

Re: Can we edit the dictionary which are pre exist

Posted: Tue Nov 15, 2022 8:59 am
by shikhar_472
Could you please update on this.

Re: Can we edit the dictionary which are pre exist

Posted: Tue Nov 15, 2022 5:26 pm
by mihaela
Hello,

If you want to save the dictionary for each editor, to update it during the editing, you can use the EditingSessionContext API. To get the editing session context you can use the ro.sync.ecss.extensions.api.access.AuthorEditorAccess.getEditingContext() method.
Please let us know if you need other information.

Best Regards,
Mihaela