[Solved] Creating/Reading dictionary info from .oxt

Java, C++, C#, Delphi... - Using the UNO bridges
Post Reply
sparticus1701
Posts: 5
Joined: Mon Feb 20, 2023 9:15 pm

[Solved] Creating/Reading dictionary info from .oxt

Post 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).
Last edited by Hagar Delest on Tue Feb 21, 2023 9:20 am, edited 1 time in total.
Reason: tagged solved.
OpenOffice 4.x on Win11
User avatar
Hagar Delest
Moderator
Posts: 32804
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Creating/Reading dictionary info from .oxt

Post 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.
LibreOffice 24.2 on Xubuntu 24.04 and 7.6.4.1 portable on Windows 10
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Creating/Reading dictionary info from .oxt

Post 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
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
sparticus1701
Posts: 5
Joined: Mon Feb 20, 2023 9:15 pm

Re: Creating/Reading dictionary info from .oxt

Post 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.
OpenOffice 4.x on Win11
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Creating/Reading dictionary info from .oxt

Post 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.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
User avatar
robleyd
Moderator
Posts: 5235
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Creating/Reading dictionary info from .oxt

Post 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.
Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.8.2.1; SlackBuild for 24.8.2 by Eric Hameleers
---------------------
Roses are Red, Violets are Blue
Unexpected '{' on line 32
.
sparticus1701
Posts: 5
Joined: Mon Feb 20, 2023 9:15 pm

Re: Creating/Reading dictionary info from .oxt

Post by sparticus1701 »

Thank you. The developers guide is what I was looking for.
OpenOffice 4.x on Win11
User avatar
Hagar Delest
Moderator
Posts: 32804
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

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

Post 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.
LibreOffice 24.2 on Xubuntu 24.04 and 7.6.4.1 portable on Windows 10
sparticus1701
Posts: 5
Joined: Mon Feb 20, 2023 9:15 pm

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

Post by sparticus1701 »

I have looked at quite a few dictionaries (around 100), and found that there is very little consistency with their structure.
OpenOffice 4.x on Win11
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

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

Post 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.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
JeJe
Volunteer
Posts: 2906
Joined: Wed Mar 09, 2016 2:40 pm

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

Post by JeJe »

Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
sparticus1701
Posts: 5
Joined: Mon Feb 20, 2023 9:15 pm

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

Post 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.
OpenOffice 4.x on Win11
JeJe
Volunteer
Posts: 2906
Joined: Wed Mar 09, 2016 2:40 pm

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

Post 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.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Post Reply