Page 1 of 1

[Solved] Creating/Reading dictionary info from .oxt

Posted: Mon Feb 20, 2023 9:19 pm
by sparticus1701
I am creating an C# app with a spell checker and want to use .oxt files. While I can see the files are zip files and contain the .dic an .aff files, what files contain the appropriate metadata, especially if there are multiple dictionaries in the file?

I haven't yet found documentation about how to create or read .oxt files.

Does such documentation exist? Even better, is there a preexisting C# library (didn't find any on Nuget).

Re: Creating/Reading dictionary info from .oxt

Posted: Mon Feb 20, 2023 10:01 pm
by Hagar Delest
Hi and welcome to the forum!

Extensions are mere packages that are uncompressed in the user profile folder (/uno_packages or the installation folder) and then accessed by the application from there.
Install a dictionary and see how the settings have been defined.
See also: [Tutorial] The OpenOffice User Profile.

Re: Creating/Reading dictionary info from .oxt

Posted: Tue Feb 21, 2023 12:54 am
by John_Ha
They are Hunspell dictionaries. See Proofing Tool.

These are some threads about working with dictionaries.

There are 59,000 lines in the Eng-GB dictionary, where the suffixes after the / define additional endings for the stem word.

Code: Select all

abject/PY
abjection/MS
abjectness/S
abjuration/M
abjure/nyRSDGN
ablate/SDG
ablation/M
ablaze
able-bodied
able/nVvYNT
abloom
ablution/SM
abnegate/NGnDS
abnegation/M
abnormal/Y
abnormality/SM
aboard
abode/MS
abolish/DGLRS
abolition/3MS
abolitionism/SM
abolitionist
abominable/Y
abominate/DnNSG
abomination/M
aboriginal
aboriginals/M
Aboriginals/M
aborigine/oSM
abort/DVGvSu

Re: Creating/Reading dictionary info from .oxt

Posted: Tue Feb 21, 2023 1:06 am
by sparticus1701
I'm not sure how that helps. I'm looking for information on how to determine what content is in the .oxt. I'm seeing various .xml files as well as a .xcu, and I need to know the correct way to use these files to know what dictionary data are in the file.

Re: Creating/Reading dictionary info from .oxt

Posted: Tue Feb 21, 2023 1:25 am
by John_Ha
sparticus1701 wrote: Tue Feb 21, 2023 1:06 am I'm not sure how that helps.
Please feel free to ignore it.

Re: Creating/Reading dictionary info from .oxt

Posted: Tue Feb 21, 2023 2:02 am
by robleyd
I'd guess you may have found https://wiki.openoffice.org/wiki/Extensions and https://wiki.openoffice.org/wiki/Docume ... Extensions but I'll link them here just in case.

Re: Creating/Reading dictionary info from .oxt

Posted: Tue Feb 21, 2023 2:11 am
by sparticus1701
Thank you. The developers guide is what I was looking for.

Re: [Solved] Creating/Reading dictionary info from .oxt

Posted: Tue Feb 21, 2023 9:23 am
by Hagar Delest
Have you checked an existing dictionary extension already?
The content is often almost self-explanatory.
NB: I did that already to tune some dics to remove the extra tick marks I don't want to appear in the languages list.

Re: [Solved] Creating/Reading dictionary info from .oxt

Posted: Tue Feb 21, 2023 4:06 pm
by sparticus1701
I have looked at quite a few dictionaries (around 100), and found that there is very little consistency with their structure.

Re: [Solved] Creating/Reading dictionary info from .oxt

Posted: Tue Feb 21, 2023 6:12 pm
by John_Ha
I think you will find a .oxt file is a container just like a .zip file is and the application decides how to utilise the contents.

Re: [Solved] Creating/Reading dictionary info from .oxt

Posted: Tue Feb 21, 2023 6:41 pm
by JeJe

Re: [Solved] Creating/Reading dictionary info from .oxt

Posted: Tue Feb 21, 2023 7:01 pm
by sparticus1701
I have looked at it. It is no longer an active project. I am using WeCantSpell.Hunspell. Neither of these packages import .oxt directly, but they do take in .dic/.aff files, which necessitates code that can identify and extract the dictionary info from the .oxt.

Re: [Solved] Creating/Reading dictionary info from .oxt

Posted: Tue Feb 21, 2023 8:52 pm
by JeJe
If you were able to use Automation, which would require the user to have OO or LO installed of course, then its easy to access and use the spelling and thesaurus using the OO or LO API.