Forum Replies Created
-
MrPaul June 27, 2014 at 6:04 pm
Reply To: Spell Checker does not behave as expected for certain words
June 27, 2014 at 6:04 pmParticipants 0Replies 14Last Activity 8 years, 7 months agoHi,
I'm trying to code around the french quote problem described in my first post. I managed to keep a safe list of prefixes that should be ignored, like “qu'”, but I still need to check the 2nd part of the word to see if it's valid.
In our custom Spell Checker class, we set the range selection to the current word and call mXmax.Document.IsSpellingCorrect() to see if it's spelled correctly or not. When I manipulate this range selection to ignore the prefix from my safe list, IsSpellingCorrect() still picks up the 2nd part even though it's a valid word on its own. I have a feeling it's because it isn't surrounded by spaces, so it still thinks it's part of the prefix I'm trying to ignore.
I can't seem to find any documentation about how this works, and there were no results for IsSpellingCorrect in the documentation:
http://xmetal.com/webhelp/en/xmetaldeveloper/pg/7.0/pg.htmlIdeally, I'd like to be able to check the spelling of a particular word; in my example above I'd like to call something like IsSpellingCorrect(“on”) and if it returns true, I continue on, otherwise I'd show the list of suggestions.
Is this possible?
MrPaul June 6, 2014 at 12:52 pm
Reply To: Spell Checker does not behave as expected for certain words
June 6, 2014 at 12:52 pmParticipants 0Replies 14Last Activity 8 years, 8 months agoThanks for the response. It helps to know that this is due to that word not being in your dictionary and not some kind of other obscure bug. We will add it to the user defined list.
Any thoughts about the quote problem when using Canadian French? Not sure how to work around that one, since it doesn't pick up the entirety of the contraction, and only the first part…MrPaul March 5, 2014 at 2:08 pm
Reply To: Using xml:lang Values to Control Spell Checking
March 5, 2014 at 2:08 pmParticipants 0Replies 14Last Activity 8 years, 11 months agoDerek,
Some of our documents have mixed languages. Mainly, I need to be able to switch between “en-ce” and “fr-cf” depending on the current position of the cursor (we have a custom spell checking module that loops through the document using a range and calls XMAX spell checking functionality). In our XML, the different language sections have a lang=1 or lang=2 attribute that I can use to determine which spell checker dictionary to use.
My question is: in which XMAX call does the value of xml:lang get read to determine if the word is spelled correctly or not? Is it inside the call to ActiveDocument.IsSpellingCorrect()? Is it a bad idea to continuously change the value of the document's doctype on the fly?
I tried testing this but using the example you provided, I am getting an “attribute exists” exception from XMAX the 2nd time it tries to set the value (since the code that checks if the word is spelled correctly loops as the range changes its selection).
Also, the first time it's added, when I view the ActiveDocument.Document.xml value, I cannot see the set xml:lang attribute. Is that normal?
Can I call docType.addAttribute with an element that isn't the root (in the 1st param)? How should I go about this?
Thank you.
EDIT: Just to add to this, if I check docType.hasAttribute(“Root”, “xml:lang”) before adding it, it will properly return false the 1st time, then true the 2nd time as to not re-add it. However, when I get to a section in the XML that is in a different language, I'd like to update this value. What's weird is that docType.attributes is empty and there doesn't seem to be a “updateAttribute” or other similar function. And again, if I re-call docType.addAttribute, it crashes with the error: “attribute exists.”. I tried playing with the intDeclType param in addAttribute (I noticed you set this to sqDTFIXED or 3 in your example) but to no avail.
The good news is that when the xml:lang attribute is set to the value “en-ce” or “fr-cf”, the proper dictionaries are used! I just need to be able to update this dynamically.MrPaul February 3, 2014 at 4:45 pm
Reply To: Using xml:lang Values to Control Spell Checking
February 3, 2014 at 4:45 pmParticipants 0Replies 14Last Activity 9 years agoI have a few questions.
1. Is all of the information still accurate for XMAX v7?
2. We've noticed the following behavior when playing with the xml:lang attribute:
xml:lang=”en” accepts “color” and “colour” as valid words.
xml:lang=”en-US” accepts “color” and stops on “colour” (expected)
xml:lang=”en-CA” does not seem to work. It doesn't even stop on “sfsdfsdfsf”.
When the xml:lang attribute is omitted entirely, it accepts “colour” but stops on “color” (is this en-CA?)xml:lang=”fr-CA” does not work either. All words are ignored.
xml:lang=”fr” seems to work for the french dictionary, but is it Canadian French?We need to be able to specify en-CA and fr-CA languages for the spell checker. How can we accomplish this?
(Also, is there an .ini file when using XMAX? I could not find one.)3. Is there an API function that we can call instead of setting the xml:lang attribute (since our current DTD does not allow it)?
Thanks.
MrPaul January 23, 2014 at 4:02 pm
Reply To: Error when trying to set attribute value
January 23, 2014 at 4:02 pmParticipants 0Replies 14Last Activity 9 years agoMy issue has been resolved. It was related to setting range.ReadOnlyContainer = True for the root node of that document. Some other code prior to setting the attribute value was being called.
So, if you try to set nodeValue on a node that has been set as readonly (or its parent was set to readonly), it will return that error!
MrPaul December 23, 2013 at 2:09 pm
Reply To: InsertWithTemplate example
December 23, 2013 at 2:09 pmParticipants 0Replies 14Last Activity 9 years, 1 month agoThanks Derek. I already had a ctm file from the application we're migrating. It's just that there weren't any “Templates” in it so I'm still not sure why InsertWithTemplate was working in v3, but doesn't in xmax v7 unless I add the missing configuration in the ctm file. It works when I do that.
For anyone else trying to accomplish the same thing, you can specify what to automatically insert when calling InsertWithTemplate when adding the following to the ctm file. For example:
[code]
Line
]]>
Then when calling:
[code]Selection.InsertWithTemplate(“Line”)[/code]
It will insert this automatically:
[code]
[/code] It works!
MrPaul December 3, 2013 at 2:10 pm
Reply To: Search and Replace
December 3, 2013 at 2:10 pmParticipants 0Replies 14Last Activity 9 years, 2 months agoThe above code works! We just upgraded to version 7 and I couldn't figure out why the Find and Replace All wasn't working, until I remembered this post. Thanks!
MrPaul October 10, 2013 at 2:47 pm
Reply To: Windows Control Panel ‘Programs and Features’ won’t let me uninstall XMetal 6.0
October 10, 2013 at 2:47 pmParticipants 0Replies 14Last Activity 9 years, 4 months agoThe MS tool worked for me! Thanks.
MrPaul September 5, 2013 at 12:56 pm
Reply To: XMAX API call for Thesaurus
September 5, 2013 at 12:56 pmParticipants 0Replies 14Last Activity 9 years, 5 months agoToo bad. Yes, ideally GetSynonyms and GetAntonyms would suit our needs since we'd have to make our own bilingual custom dialog. Please keep me posted on the other possible solution though since we are using XMAX v6 at the moment.
MrPaul June 10, 2013 at 6:44 pm
Reply To: Search and Replace
June 10, 2013 at 6:44 pmParticipants 0Replies 14Last Activity 9 years, 8 months agoI am experiencing some problems with the “whole words” flag for replace all as well. Can you confirm if this is also an issue (in addition to match case)?
In which version of XMAX has this been fixed? We are using XMAX version 6.0.0.159.MrPaul April 23, 2013 at 8:55 pm
Reply To: Show or Hide inline images
April 23, 2013 at 8:55 pmParticipants 0Replies 14Last Activity 9 years, 9 months agoOk, thanks.
MrPaul April 16, 2013 at 1:05 pm
Reply To: Set properties of multiple selected table cells
April 16, 2013 at 1:05 pmParticipants 0Replies 14Last Activity 9 years, 10 months agoIs this still the case for XMAX v6 or later? Is there still no way to access the selected cells of a CALS table?
MrPaul April 8, 2013 at 6:35 pm
Reply To: Moving Rows and Columns for CALS Table
April 8, 2013 at 6:35 pmParticipants 0Replies 14Last Activity 9 years, 10 months agoI'm not sure I understand your steps 3 and 4. When you talk about moving the range backwards, do you mean using ActiveDocument.Range.MoveUp()? Do I need to move up more than once to check if it has a row above the current selection or will MoveUp always go to the previous row, even if the selection is in the top most tbody row (row 2a in my example) and the table has a header?
[code]
header 1a
header 1b
header 1c
row 2a
row 2b
row 2c
row 3a
row 3b
row 3c
[/code]
I'm also unsure about what you mean for checking that previousSibling is also a row. Could you provide an example?
I have something like this:
[code]var rng = ActiveDocument.Range;
rng.MoveUp();
if (Selection.IsEqual(rng)) {
// cannot move row up
else {
// can move row up
}[/code]I was hoping that rng.MoveUp() would stay put when the selection is in “header 1a” in my example, but it still seems to change so this code always falls into the else…
MrPaul March 19, 2013 at 2:12 pm
Reply To: Move cursor inside node from selection
March 19, 2013 at 2:12 pmParticipants 0Replies 14Last Activity 9 years, 10 months agoInformative, thank you.
MrPaul March 14, 2013 at 1:20 pm
Reply To: XMAX Full API Documentation for version 6 and 7
March 14, 2013 at 1:20 pmParticipants 0Replies 14Last Activity 9 years, 11 months agoDocument.InlineMediaVisible is also present in the readme of version 6 under new APIs (with the exact same description). What's changed in version 7? How would we set this in .NET using the AxXMetaLControlLib.AxXMetaLControl object? In VB6, we seem to be able to access it but it's read only. So how do we set it?
Thanks.
-
AuthorPosts