trying to ignore a couple of strings

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fredc
    Journeyman
    • Mar 2005
    • 10

    trying to ignore a couple of strings

    I need to compare my html files and consider these two strings unimportant: "·" and "∙"
    >> Edit... I just noticed that my entities didn't come through.
    >> The two strings are &_#8729; and &_#183; without the underscore.

    I have figured out that there is a "grammar rules" feature... I just can't get it to work. I wouldn't mind just ignoring those strings even if they don't match up positionally in the document.
    Step by step one thing I have tried.

    1. Select the two files and compare, they are exactly the same except one uses "·" in places and the other uses "∙" in places.
    2. Observer the lines with differences pointing out those entities.
    3. Click on the little "Rules referee icon" select the "Importance" tab, click on "Edit Grammar...".
    4. Click on "New...": Set "Element Name:" to "Entity"; "Category:" to "Basic"; "Text Matching" to "&_#8729;". Click "Ok". (Remove the underscore, wouldn't post correctly without it.)
    5. Click on "New...": Set "Element Name:" to "Entity"; "Category:" to "Basic"; "Text Matching" to "&_#183;". Click "Ok".
    6. Click "Ok" in the Grammar window.
    7. Un-Check "Entity" in the "Grammar Elements" list.
    8. Click "Ok"

    Result: The compare window refreshes, but the entities are still flagged as different. I toggled the "Ignore Unimportant Differences" button a couple times to make sure I had it set right. It had no effect.

    I also tried a "Category" of "List" in the Grammar rules.

    What am I doing wrong?
    Is this a missing feature?
    Thanks
    Last edited by fredc; 05-Nov-2008, 01:14 PM. Reason: Noticed that my entities didn't show up.
  • Michael Bulgrien
    Carpal Tunnel
    • Oct 2007
    • 1772

    #2
    It sounds like you should be using replacements instead of grammar rules in this situation.
    BC v4.0.7 build 19761
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

    Comment

    • Erik
      Team Scooter
      • Oct 2007
      • 437

      #3
      Hi Fred,

      I tried the steps you've provided and everything is behaving as expected. Could you send sample files and your settings (Help -> Support -> Export) to [email protected]?

      Thanks,
      Erik Scooter Software

      Comment

      • fredc
        Journeyman
        • Mar 2005
        • 10

        #4
        Thanks for the suggestion Michael. Yes, replacements are exactly what I needed in this case, and they work perfectly. I didn't see that feature.

        Comment

        • fredc
          Journeyman
          • Mar 2005
          • 10

          #5
          I have sent in my files Erik. And yes, I can still repro the "bug" if you even want to call it that. It turns out that if I setup grammar rules to ignore a couple of words like "ignore" and "this". Then my test works just fine. But with those entities it doesn't. And like Michael pointed out, replacements is what I wanted anyways, and they work.

          Comment

          • fredc
            Journeyman
            • Mar 2005
            • 10

            #6
            I just noticed that my entities didn't come through in my original post, which makes a bunch of difference in understing. The two strings are &_#8729; and &_#183; without the underscore.

            Comment

            • Erik
              Team Scooter
              • Oct 2007
              • 437

              #7
              Hi Fred,

              Thanks for the files and settings. The reason you weren't getting the behavior you expected is that the new grammar items you defined (&_#139; and &_#8729) never actually will be used. This is because the &_#\d+; grammar item matches the same text and since it is higher on the list, it gets precedence. Thus the solution is to move your new grammar items before it.
              Erik Scooter Software

              Comment

              • fredc
                Journeyman
                • Mar 2005
                • 10

                #8
                As usual, something really simple once you know what to look for. Thanks much Erik!

                Comment

                Working...