xychange won't recognize an em-dash

I am trying to write a xychange transformation that matches on an em-dash that is preceded or followed by a space and outputs an em-dash without the space. Transforming Data doc (Table 3-2) shows several ways to represent an em-dash but I can't get my match to recognize any of them. Seems simple enough but apparently too tough for me... Can anyone help?

Parents
  • Here's the whole story.

    We got this request from a client at ETS: "We would like XPP to explore a solution that would ensure spaces appear where required. Specifically, we would always want there to be a space between immediately adjacent end and start focus tags. There would be only one exception: when such appear directly before or after an em dash, no space should be inserted.

    RULE 1) I wrote a rule which looks for <focus_end><focus_start> tags that have no space between them and adds a space. This works:
    Match:  <focus_end focus_idref="*"/><focus_start focus_id="*" itemref="*"/>
    Output: <focus_end focus_idref="*"/> <focus_start focus_id="*" itemref="*"/>

    To handle the exceptions I wrote two rules where the Match and the Output are the same.

    RULE 2) This rule is for when the tags are preceded by an em-dash:
    Match:  \M<focus_end focus_idref="*" focus_number="*"/><focus_start itemref="*" focus_id="*" focus_number="*"/>
    Output: \M<focus_end focus_idref="*" focus_number="*"/><focus_start itemref="*" focus_id="*" focus_number="*"/>

    RULE 3) and this rule is for when the tags are followed by an em-dash:
    Match:  <focus_end focus_idref="*" focus_number="*"/><focus_start itemref="*" focus_id="*" focus_number="*"/>\M
    Output: <focus_end focus_idref="*" focus_number="*"/><focus_start itemref="*" focus_id="*" focus_number="*"/>\M

    Rules 2 and 3 do not work. Eventually I realized my rules were not recognizing an em-dash. So I tried this:

    RULE 4)
    Match:  \M
    Output: \M<^!--em dash-->

    ...and that does not work.

Reply
  • Here's the whole story.

    We got this request from a client at ETS: "We would like XPP to explore a solution that would ensure spaces appear where required. Specifically, we would always want there to be a space between immediately adjacent end and start focus tags. There would be only one exception: when such appear directly before or after an em dash, no space should be inserted.

    RULE 1) I wrote a rule which looks for <focus_end><focus_start> tags that have no space between them and adds a space. This works:
    Match:  <focus_end focus_idref="*"/><focus_start focus_id="*" itemref="*"/>
    Output: <focus_end focus_idref="*"/> <focus_start focus_id="*" itemref="*"/>

    To handle the exceptions I wrote two rules where the Match and the Output are the same.

    RULE 2) This rule is for when the tags are preceded by an em-dash:
    Match:  \M<focus_end focus_idref="*" focus_number="*"/><focus_start itemref="*" focus_id="*" focus_number="*"/>
    Output: \M<focus_end focus_idref="*" focus_number="*"/><focus_start itemref="*" focus_id="*" focus_number="*"/>

    RULE 3) and this rule is for when the tags are followed by an em-dash:
    Match:  <focus_end focus_idref="*" focus_number="*"/><focus_start itemref="*" focus_id="*" focus_number="*"/>\M
    Output: <focus_end focus_idref="*" focus_number="*"/><focus_start itemref="*" focus_id="*" focus_number="*"/>\M

    Rules 2 and 3 do not work. Eventually I realized my rules were not recognizing an em-dash. So I tried this:

    RULE 4)
    Match:  \M
    Output: \M<^!--em dash-->

    ...and that does not work.

Children
No Data