Page 1 of 3 123 LastLast
Results 1 to 10 of 22
  1. #1
    Join Date
    Jan 2014
    Posts
    12

    Default Help with alignment

    I am comparing two text files. One file just uses a custom file format. It's a text file basically. The other uses YAML 1.2, with custom condition string syntax modeled after Python's condition expressions.

    On one side I will have a file name like

    Essential Whiterun horses.esp

    The other side will have

    - name: 'Essential Whiterun horses.esp'

    They don't always line up.

    On one side I will have a string of

    BEGINGROUP: Official ESMs

    The other side will have

    # BEGINGROUP: Official ESMs

    They don't always line up.

    I added 'BEGINGROUP: and 'ENDGROUP:' as strings in the Rules under Importance. I also tried setting one side as xml and the other as rtf and then adding '# BEGINGROUP:' to the xml grammer, and 'BEGINGROUP:' to the rtf grammer. However, no matter what I try those lines don't match up. One text file has over 80,000 lines in it and the other has over 50,000 lines. The difference in line location might be over 6000 lines different.

    Is there a way to help them line up better>

  2. #2
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,788

    Default

    Hello,

    The key for file name alignment would be to determine how the file names are different. File names only align if they have the exact same name. Sometimes, whitespace or an odd character can cause them to not align, so I recommend selecting a file, right-click, and use Copy Filename, then paste into a Text Compare to compare the text of the two file names you expect to align.

    For the text within a file, this depends on several factors including the defined grammar elements, line weights, and the Alignment (Session Setting) options. Here you can alter the skew to increase it, or use the Alternate method. You can also use the right-click Align With option to manually align selected text on one side with another.

    How do these tips help improve your current Folder Compare alignment, or the Text Compare text alignment?
    Aaron P Scooter Software

  3. #3
    Join Date
    Jan 2014
    Posts
    12

    Default

    Quote Originally Posted by Aaron View Post
    Hello,
    For the text within a file, this depends on several factors including the defined grammar elements, line weights, and the Alignment (Session Setting) options. Here you can alter the skew to increase it, or use the Alternate method. You can also use the right-click Align With option to manually align selected text on one side with another.

    ...Snip, I am comparing within a text file..., or the Text Compare text alignment?
    I clicked on the icon that looks like a Basball Ref, Rules, and then I added 'BEGINGROUP: and 'ENDGROUP:' as strings in the Rules under Importance -> Grammar. On the alignment tab I increased it from 2000 to 4000 and I tried the alternate method but it didn't force the alignment of the 'BEGINGROUP: and 'ENDGROUP:' tags.

    I can search the document and use the Align With option but since the 'BEGINGROUP: and 'ENDGROUP:' are distinctive I was hoping that at least they would line up is I added that to the grammar section.

    Should those be Strings, or should I choose Enviorment Variable, comment, lable, would another choice other then string help?

  4. #4
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,788

    Default

    Hello,

    Defining the grammar only helps the algorithm. How far apart are the lines you are trying to match on? You may need to increase the Skew further (you can type a value in). Have you defined a Line Weight (in the File Format) or tried the Alternate Alignment Method in the Alignment tab of the Session Settings (also as the Rules/referee button on the toolbar)?
    Aaron P Scooter Software

  5. #5
    Join Date
    Jan 2014
    Posts
    12

    Default

    Quote Originally Posted by Aaron View Post
    Hello,

    Defining the grammar only helps the algorithm. How far apart are the lines you are trying to match on?
    6000-7000

    Quote Originally Posted by Aaron View Post
    You may need to increase the Skew further (you can type a value in).
    I'll try that.

    Quote Originally Posted by Aaron View Post
    or tried the Alternate Alignment Method in the Alignment tab of the Session Settings (also as the Rules/referee button on the toolbar)?
    Yes.

    Quote Originally Posted by Aaron View Post
    Have you defined a Line Weight (in the File Format)
    No. Not sure where to go to do that.

  6. #6
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,788

    Default

    Line Weights are defined in the Tools menu -> File Formats, select your format, and in the Grammar section, below the list of the grammar elements is the list of the Line Weights.

    The Skew Tolerance should probably also then be 7000+ to increase the search range to be sufficiently large.
    Aaron P Scooter Software

  7. #7
    Join Date
    Jan 2014
    Posts
    12

    Default

    Quote Originally Posted by Aaron View Post
    Line Weights are defined in the Tools menu -> File Formats, select your format, and in the Grammar section, below the list of the grammar elements is the list of the Line Weights.

    The Skew Tolerance should probably also then be 7000+ to increase the search range to be sufficiently large.
    I'll try that and see if it helps.

    Thanks for the assistance so far.

  8. #8
    Join Date
    Jan 2014
    Posts
    12

    Default

    Quote Originally Posted by Sharlikran View Post
    I'll try that and see if it helps.

    Thanks for the assistance so far.
    Nope it's not really doing the trick either. If I change the file and switch between files once the view changes it has to recalculate the whole file, again. So each time it does that is looses the manual alignment I assigned. I'm asking a lot of the program to line up over 6000 lines but the BEGINGROUP: and ENDGROUP: only appear less then 200 times out of 80,000 lines. They have things like 'BEGINGROUP: Base Q' so there is text after it.

    Each file has the exact same amount of tags. I meticulously put them in each files to try this weighted line alignment but I don't see a way to set weights that will make BC align this 'BEGINGROUP: Basw Q' exactly no exceptions, and then do a fuzzy logic for the rest of the file.

    Oh is there a way to say, match text at the beginning of the line? Because the labels are at the beginning of a line always.

    For now with all the weights, and adding the file as a file format, and the labels as priority five, the program matches this line "ENDGROUP: Items K" with this line " - name: Ket_WEAPONIZER.esp" which isn't even remotely the same. I am expecting it to match "ENDGROUP: Items K" with "ENDGROUP: Items K".

    I feel like adding the weights is messing up the logic of the program, or I have to do something like scripting or something complex to make the program say match up lines with this text, and this text 100%, and then for the rest just do your best to find a close match.
    Last edited by Sharlikran; 14-Jan-2014 at 11:25 PM.

  9. #9
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    2,519

    Default

    Can you email your files to support@scootersoftware.com? There may be something obvious that we'll be able to catch by seeing them in person.

    Line weights only apply to lines that match exactly (possibly with unimportant differences), and only using the standard alignment. To force an alignment of BEGINGROUP/ENDGROUP, set up your file formats so that everything else on those lines is unimportant, then set the line weights for those strings to the maximum value you can (5000?).
    ZoŽ P Scooter Software

  10. #10
    Join Date
    Jan 2014
    Posts
    12

    Default

    Finally, I figured it out. I'm too excited at the moment to post. I want to actually work on the documents. I'll post tomorrow exactly what I did. I did use your suggestions granted but maybe I wasn't being clear enough with my expectations.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •