"Unimportant" Text Agen

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • altdesign
    Visitor
    • Nov 2011
    • 7

    "Unimportant" Text Agen





    Where I was wrong

    PS sorry for my english

    Нужно настроить правила сравнения таким образом, чтобы отличие VAR vs VARIABLE было несущественным. В примере видно, что мое правило работает только тогда, когда после VAR ввел два пробела.
    В указанном примере нужно добиться, чтобы изменения во всех строках были несущественные, за исключением третьей (там где rows1)

    google translate:
    Need to set rules for the comparison so that the difference VAR vs VARIABLE was "Unimportant". The example shows that my rule works only when the following VAR has introduced two spaces.
    In the above example must be made to change all the lines were insignificant, except for the third (where rows1)
    Last edited by altdesign; 04-Nov-2011, 03:46 AM.
  • Aaron
    Team Scooter
    • Oct 2007
    • 15997

    #2
    Hello,

    Your picture links appear to be broken. Would you be able to post again or email us at [email protected] ?
    Aaron P Scooter Software

    Comment

    • altdesign
      Visitor
      • Nov 2011
      • 7

      #3
      Update external link to image

      Comment

      • Aaron
        Team Scooter
        • Oct 2007
        • 15997

        #4
        Hello,

        Thanks for the updated screenshot. I notice the issue in the 2nd difference section with DEF VAR. If you enable the View menu -> Aligned Details, is it aligning as you expect or is that the problem?

        It looks like you may want to look at our BC3 Pro feature, Text Replacements. Text Replacements let you define:
        "DEFINE" = "DEF"
        and
        "VARIABLE" = "VAR"

        They are in the Session Settings, Replacements tab, of the Text Compare. If you need to revert to trial mode to test this Pro feature, please read this guide:
        http://www.scootersoftware.com/suppo...?zz=kb_evalpro

        If you are still having trouble, would it be possible to get an email with a pair of sample files? If you email us at [email protected] , please also include a link back to this forum thread for our reference.
        Aaron P Scooter Software

        Comment

        • Michael Bulgrien
          Carpal Tunnel
          • Oct 2007
          • 1772

          #5
          Originally posted by altdesign
          Where I was wrong
          Create a grammar list for DEF and DEFINE
          http://screencast.com/t/zqEeV4kpl2ss

          Create a grammar list for VAR and VARIABLE
          http://screencast.com/t/rzfwtLeIOyn

          Uncheck the grammar rules to make them unimportant
          http://screencast.com/t/LKkgQN5NA

          Result:
          http://screencast.com/t/JBHz1n0CR
          BC v4.0.7 build 19761
          ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

          Comment

          • altdesign
            Visitor
            • Nov 2011
            • 7

            #6
            Hello,

            Originally posted by Aaron
            If you enable the View menu -> Aligned Details, is it aligning as you expect or is that the problem?
            is that the problem


            Originally posted by Aaron
            Text Replacements let you define:
            "DEFINE" = "DEF"
            and
            "VARIABLE" = "VAR"
            well done!


            but I have done so:
            "DEFINE" = "DEF " (with space at the end)
            "VARIABLE" = "VAR " (with space at the end)
            "DEF" = "DEFINE " (with space at the end)
            "VAR" = "VARIABLE " (with space at the end)

            and result


            else

            "DEFINE" = "DEF" (NO space at the end)
            "VARIABLE" = "VAR" (NO space at the end)
            "DEF" = "DEFINE" (NO space at the end)
            "VAR" = "VARIABLE" (NO space at the end)

            result

            Comment

            • altdesign
              Visitor
              • Nov 2011
              • 7

              #7
              TEXT1:
              DEFINE INPUT PARAMETER rid-doc AS INTEGER.
              DEFINE VARIABLE i AS INTEGER.
              DEFINE VARIABLE rows AS INTEGER.
              DEFINE VARIABLE tovar AS CHARACTER.
              DEFINE VARIABLE sum AS DECIMAL.
              DEFINE VARIABLE cost AS DECIMAL.
              DEFINE VARIABLE doc-date AS DATE.

              TEXT2:
              DEF INPUT PARAMETER rid-doc AS INTEGER.
              DEF VAR i AS INTEGER.
              DEF VAR rows AS INTEGER.
              DEF VAR tovar AS CHARACTER.
              DEF VAR sum AS DECIMAL.
              DEF VAR cost AS DECIMAL.
              DEF VAR doc-date AS DATE.
              Last edited by Aaron; 08-Nov-2011, 09:49 AM.

              Comment

              • Aaron
                Team Scooter
                • Oct 2007
                • 15997

                #8
                Hello,

                Thanks for the sample files. That was certainly puzzling before I was able to check against them.

                It looks like your Keyword grammar is defined to include DEFINE and def (with a space), and is higher in the grammar list. You also have explicit DEFINE+Whitespace regular expression grammars. The grammar list's priority heavily influences which it will match on, but a higher priority does not guarantee a match (due to several factors, such as left starting character).

                The end results is using your Progress file format, the left file is matching the DEFINE text to the DEFINE grammar, and your right file is matching DEF to the Keyword grammar. Because they are different grammars, the entire text will be marked as a difference (including any whitespace that is part of the grammar definition and not default text).

                Do you need "define" text defined as part of two different grammar elements of the same file format?

                UPDATE: I also removed your settings files from your forum post. Some basic info (user account name, install location, etc) are present, and I'm not sure if you intended that for our public forum.
                Last edited by Aaron; 08-Nov-2011, 09:51 AM. Reason: UPDATE: edited to remove Support.zip
                Aaron P Scooter Software

                Comment

                • Michael Bulgrien
                  Carpal Tunnel
                  • Oct 2007
                  • 1772

                  #9
                  There should not be any need to use replacements or regular expressions. Did you try removing them and using simple grammar lists like I demonstrated in my previous post above?
                  BC v4.0.7 build 19761
                  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

                  Comment

                  • altdesign
                    Visitor
                    • Nov 2011
                    • 7

                    #10
                    Originally posted by Michael Bulgrien
                    Did you try removing them and using simple grammar lists like I demonstrated in my previous post above?
                    Добрый день. Да, я попробовал Ваш способ. Но результат был неудовлетворительный.

                    Hello. Yes, I tried your way. But the result was unsatisfactory.

                    Comment

                    • altdesign
                      Visitor
                      • Nov 2011
                      • 7

                      #11
                      Originally posted by Aaron
                      Do you need "define" text defined as part of two different grammar elements of the same file format?
                      I want to keep a selection of key operands language PROGRESS and to ignore differences like DEF = DEFINE

                      Originally posted by Aaron
                      UPDATE: I also removed your settings files from your forum post. Some basic info (user account name, install location, etc) are present
                      thank you

                      Comment

                      • altdesign
                        Visitor
                        • Nov 2011
                        • 7

                        #12
                        Убрал лишние пробелы после DEF, VAR и других в списке Keywords

                        I removed the extra spaces after DEF, VAR and others in the list of Keywords

                        Comment

                        • Aaron
                          Team Scooter
                          • Oct 2007
                          • 15997

                          #13
                          If you need DEF/DEFINE in two different grammars, it will match on one grammar or the other. This can be controlled by moving the grammar items higher or lower in the list, but other factors can impact which is used. If two different grammars are picked, it will be marked as a difference.

                          A scenario like this is why we created the Text Replacements feature. You can try a workaround using unimportant text, but it will not be as easy or elegant.

                          Does the Text Replacements feature meet your needs by having define as a Keyword, and then a replacement for DEF = DEFINE?
                          Aaron P Scooter Software

                          Comment

                          Working...