Learned Spelling in xml-Format

For all things Mellel

Moderators: Eyal Redler, redlers, Ori Redler

Post Reply
matthias
Knows everything, can prove it
Posts: 131
Joined: Thu Oct 27, 2005 4:12 pm
Location: Berlin, Germany

Learned Spelling in xml-Format

Post by matthias »

I see from the release notes of Mellel 2.1. that the learned spelling file is now in .xml-format. I am wondering what the benefit of this file type is. I was hoping that I could open and edit a list of learned spelling like it is possible in MS-Word, but it won't open in Mellel, at all. Nevertheless I find this is a comfortable way to check the content of my learned spelling file as to whether some unwanted words have made their way into this file. The other method of using the OS spell checker's forget button is somewhat cumbersome since I have to know exactly the word I want the spell checker to forget.

In short: Is there a way to open the learned spelling file, edit it, and save it again for use in Mellel?

Matthias
ozean
Knows everything, can prove it
Posts: 322
Joined: Thu Oct 20, 2005 12:28 pm
Location: Norway
Contact:

Post by ozean »

Strange, I never had the idea that one would want to open the spellings file in Mellel instead of in a text editor. I would guess the reason for this is that a list of words belonging to different categories is something distinctly different to a flow of text that contains individual formatting, notes, headings, etc.

Therefore, I think it would only make sense if Mellel opens this file in a special kind of editor that saves users from inadvertently corrupting this list. However, that would require coming up with a special gui and so forth… From my perspective such a feature would be very low on my list of wanted features. Text/XML Editors like Smultron and TextWrangler (both freeware) are ok at such a task. One could probably easily program a small app geared to editing these files, since the XML used for the spelling list seems to be quite easy to interpret. (That would require basic programming skills though, over which I do not have command.)
matthias
Knows everything, can prove it
Posts: 131
Joined: Thu Oct 27, 2005 4:12 pm
Location: Berlin, Germany

Post by matthias »

ozean wrote:Strange, I never had the idea that one would want to open the spellings file in Mellel instead of in a text editor. I would guess the reason for this is that a list of words belonging to different categories is something distinctly different to a flow of text that contains individual formatting, notes, headings, etc.
Well, it might be strange to some, but I remeber a discussion on the forum where several users supported the idea of a simple method to manipulate the entries in the learned spelling file. As a reaction the Redlers said they would change the format so that easier manipulation would be possible. So, it was my uniformed guess that this was the intention when they changed the file format to .xml. Opening in a text editor is an option I will look into. Thanks for the tip.

ozean wrote:Therefore, I think it would only make sense if Mellel opens this file in a special kind of editor that saves users from inadvertently corrupting this list. However, that would require coming up with a special gui and so forth… From my perspective such a feature would be very low on my list of wanted features. Text/XML Editors like Smultron and TextWrangler (both freeware) are ok at such a task. One could probably easily program a small app geared to editing these files, since the XML used for the spelling list seems to be quite easy to interpret. (That would require basic programming skills though, over which I do not have command.)
Well it depends. Do you know MS Word's customisable user dictionary? I think from a user perspective this is quite well implemented. So, even though such a feature is likewise not very high on my list, I used it as an example to illustrate my question. If manipualtion of the data in the learned spelling file will work smoothly (i.e. without any xml. tags reshuffling or the like) in one of the text editors you suggested, then my problem will be solved and the case closed.
Writing an application would not be a solution for me. I do not have any programming skills. That's basically one of the reasons why I have been using a Mac for the last 14 years. So the "creating-a-small-app-solution" would not be for me.

Matthias
Eyal Redler
Co-founder
Posts: 694
Joined: Thu Oct 27, 2005 9:15 am

Re: Learned Spelling in xml-Format

Post by Eyal Redler »

matthias wrote:I see from the release notes of Mellel 2.1. that the learned spelling file is now in .xml-format. I am wondering what the benefit of this file type is.
The benefit is that while we don't provide (yet) a way to edit this list directly from Mellel, you can edit it with a text editor.
matthias wrote: In short: Is there a way to open the learned spelling file, edit it, and save it again for use in Mellel?
Yes. While Mellel is not running, open it with text edit or in a dedicated XML Editor and remove the words you want removed. Save the file and run Mellel again....
Eyal Redler
----------------------
Co-Founder and Owner at Mellel
Facebook: http://www.facebook.com/mellelwordprocessor
YouTube: http://www.youtube.com/user/MellelRedlex
Donate: https://www.paypal.com/donate/?hosted_b ... 2LWB33YBZW
ozean
Knows everything, can prove it
Posts: 322
Joined: Thu Oct 20, 2005 12:28 pm
Location: Norway
Contact:

Post by ozean »

I just opened the file test-wise in TextEdit and saw that by default, TextEdit seems to open it with the wrong encoding causing non-ascii characters like umlauts (öäü) not to be displayed correctly.

TextWrangler opened the file without problems.

The file seems to be encoded as UTF-8 - perhaps one could put an encoding declaration into the header of the file or save it with a byte order mark (BOM)?

I just opened the "Learned Spellings.xml" file in TextWrangler and saved it with a BOM and now TextEdit opens the file correctly.

Maybe including the BOM would be a Good Thing™ since it would allow users to access the XML files with the tools that are included with OS X? (This would also go true for the MeXML files, which are also opened with the wrong encoding by TextEdit.) Then again, maybe this is just TextEdit’s fault. However, since I completely agree with Matthias that being able to easily edit the Learned Spellings file would be a boon, it would be good to make this as easy as possible (and perhaps mention the possibility to do this in the manual).

In any case, if one uses TextEdit’s open file dialog one can choose the encoding and therefore work around this issue…
Eyal Redler
Co-founder
Posts: 694
Joined: Thu Oct 27, 2005 9:15 am

Post by Eyal Redler »

ozean wrote:Maybe including the BOM would be a Good Thing™ since it would allow users to access the XML files with the tools that are included with OS X?
A BOM is relevant only if the file is UTF-16 which it isn't. Adding the encoding declaration (which is one of the things we fix with Mellel 2.1.1) will not help TextEdit since text edit ignores it AFAIK.
Eyal Redler
----------------------
Co-Founder and Owner at Mellel
Facebook: http://www.facebook.com/mellelwordprocessor
YouTube: http://www.youtube.com/user/MellelRedlex
Donate: https://www.paypal.com/donate/?hosted_b ... 2LWB33YBZW
joewiz
Knows everything, can prove it
Posts: 199
Joined: Sun Oct 23, 2005 9:42 pm

Post by joewiz »

From http://www.unicode.org/faq/utf_bom.html#29

Q: Can a UTF-8 data stream contain the BOM character (in UTF-8 form)? If yes, then can I still assume the remaining UTF-8 bytes are in big-endian order?

A: Yes, UTF-8 can contain a BOM. However, it makes no difference as to the endianness of the byte stream. UTF-8 always has the same byte order. An initial BOM is only used as a signature — an indication that an otherwise unmarked text file is in UTF-8. Note that some recipients of UTF-8 encoded data do not expect a BOM. Where UTF-8 is used transparently in 8-bit environments, the use of a BOM will interfere with any protocol or file format that expects specific ASCII characters at the beginning, such as the use of "#!" of at the beginning of Unix shell scripts.
Post Reply