Loading ...
Sorry, an error occurred while loading the content.

Re: [NTB] editing ADD TO dictionary

Expand Messages
  • hsavage
    ... word I ... find it ... Adair. ... .udt s, ... to Al and list, I ve written a clip that does most of what s needed to a .udt file, works pretty well. Here;
    Message 1 of 3 , Nov 27, 2009
    View Source
    • 0 Attachment
      hsavage wrote:
      > AL Guevara wrote:
      >> I must be mental, I cant find the place to edit a misspelled
      word I
      > put in there. Can someone tell me wher this is on v6 Pro? I cant
      find it
      > anyhwere.
      >> Thank you much!
      >>
      >> Al Guevara
      >
      > Al,
      >
      > There's no easy way, other than a series of clips written by Jody
      Adair.
      > AFAIK, there's no built-in function to make corrections to the
      .udt's,
      > User-defined dictionaries.
      >
      > You may also, have a couple of libraries to accomplish editing.
      >
      > They are edit.udt & dir list.clb, and, edit.udt.clb clipbooks.

      to Al and list,

      I've written a clip that does most of what's needed to a .udt file,
      works pretty well.

      Here;
      -------------------------------------------
      H="UDT Strip_Re-Sort_Re-Number"
      ; • Modified-Updated~Created_2009.11.27
      ; • hrs ø hsavage·pobox·com_02:11:30p
      ^!ClearVariables
      ; to insure the default .ini file is in use.
      ^!SetIniFile
      ^!SetScreenUpdate 0
      ^!SetWizardTitle "EDIT .UDT"
      ^!SetWizardLabel "SELECT .UDT FILE"
      ^!SetWizardWidth 99
      ; the path in this wizard should be the default path to dictionaries.
      ^!Open "^?{(T=O)=^$GetAppPath$Dictionaries\default.udt}" /j=1
      ; •····
      ;^!SetDebug 1
      ; •----
      ^!IfDiff '^$GetExt(C:\Documents and
      Settings\User\desktop\emdoc.emd)$' '.udt' Exit
      ^!Select 2
      ^!Replace "\d+" >> "" TIHRSA
      ^!SaveValue udt_TOP=^$GetSelection$
      ^!Menu Edit/Delete
      ;
      ^!Find [Auto Correct] TIS
      ^!SelectTo ^$GetLineCount$:1
      ^!SaveValue udt_BOTTOM=^$GetSelection$
      ^!Menu Edit/Delete
      ;
      ^!Replace "IGN_\d+=" >> "" TIWRSA
      ;^!Menu Modify/Lines/Sort/Ascending
      ^!Select ALL
      ^$StrTrim(^$StrSort("^$GetSelection$";0;1;1)$)$
      ^!Select ALL
      ;
      ^!KeyBoard Shift+Ctrl+N &150 #0# Enter
      ^!Menu Modify/Alignment/Left Align
      ^!Replace ^(\d*) >> IGN_$1 TIWRSA
      ;
      ^!Jump Text_End
      ^!Set %lines%=^$GetLineCount$
      ^!InsertText ^%nL%^$GetValue("udt_BOTTOM")$
      ;
      ^!Jump Text_Start
      ^!InsertText ^$GetValue("udt_TOP")$^%lines%^%nL%
      ^!Save
      ------------------------------------------------

      Run on a backup copy first. The .udt will then be loaded/focused.
      Make any necessary spelling corrections or line deletions, save file
      and re-run the clip for a finished .udt file.

      ·············································
      ºvº SL_day# 331 - created 2009.11.27_15.50.00

      The same hammer that breaks the glass forges the steel.
      • Russian Proverb

      € hrs € hsavage € pobox € com

      >
    • flo.gehrke
      ... Harvey, Thanks for this clip! However, I ve got some problems with this solution: 1. The line... ^!IfDiff ^$GetExt(C: Documents and
      Message 2 of 3 , Nov 27, 2009
      View Source
      • 0 Attachment
        --- In ntb-clips@yahoogroups.com, hsavage <hsavage@...> wrote:
        >
        > I've written a clip that does most of what's needed to a .udt file,
        > works pretty well.
        >
        > Here;
        > -------------------------------------------
        > H="UDT Strip_Re-Sort_Re-Number"
        > ; • Modified-Updated~Created_2009.11.27
        > ; • hrs ø hsavage·pobox·com_02:11:30p
        > ^!ClearVariables
        > ...

        Harvey,

        Thanks for this clip!

        However, I've got some problems with this solution:

        1. The line...

        ^!IfDiff '^$GetExt(C:\Documents and Settings\User\desktop\emdoc.emd)$' '.udt' Exit

        will always lead to exit because '.emd' and '.udt' are different. So the clip just opens the UDT but doesn't change anything at all.

        2. It doesn't re-number the entries. So we get lines like...

        IGN_Adam
        IGN_Eve

        where it should be...

        IGN_9=Adam
        IGN_10=Eve

        for example. That's caused by...

        ^!Replace "IGN_\d+=" >> "" TIWRSA

        which removes the whole search string including the number and the '='. Consequently, some lines later...

        ^!Replace ^(\d*) >> IGN_$1 TIWRSA

        inserts no numbers and no '=' -- they are lost!

        3. I wonder why you save the lines in a NoName01.txt with...

        ^!KeyBoard Shift+Ctrl+N &150 #0# Enter

        4. When testing this clip one should note that it changes the INI. In order to avoid that I saved those line on top and at the bottom in variables.

        5. Let me repeat what we have discussed "behind the scenes" of this group:

        With NT Pro 6.12 I've never seen any need to sort and to re-number the lines of an UDT this way. It's always properly and automatically done by NT itself.

        When removing a word from an UDT, I just delete the word and leave 'IGN_10=', for example, untouched, i.e. "empty". The next time I add a new word to the UDT, the dictionary will be automatically sorted and re-numbered by NT, and 'IGN_10=' will be populated again. So, from my point of view, I wonder why someone needs a clip like this.

        I hope some other members will report their experiences with that issue.

        Regards,
        Flo
      • hsavage
        ... Flo, this should be the line. I use NoteTab to write email and sometimes Functions get expanded by Notetab and I forget to check when transferring text
        Message 3 of 3 , Nov 27, 2009
        View Source
        • 0 Attachment
          flo.gehrke wrote:
          > --- In ntb-clips@yahoogroups.com, hsavage <hsavage@...> wrote:
          >> I've written a clip that does most of what's needed to a .udt file,
          >> works pretty well.
          >>
          >> Here;
          >> -------------------------------------------
          >> H="UDT Strip_Re-Sort_Re-Number"
          >> ; • Modified-Updated~Created_2009.11.27
          >> ; • hrs ø hsavage·pobox·com_02:11:30p
          >> ^!ClearVariables
          >> ...
          >
          > Harvey,
          >
          > Thanks for this clip!
          >
          > However, I've got some problems with this solution:
          >
          > 1. The line...
          >
          > ^!IfDiff '^$GetExt(C:\Documents and Settings\User\desktop\emdoc.emd)$' '.udt' Exit

          Flo, this should be the line. I use NoteTab to write email and
          sometimes Functions get expanded by Notetab and I forget to check
          when transferring text back to the email client.

          ^!IfDiff '^$GetExt(^##)$' '.udt' Exit

          Correct this line and it should work fine.

          > Regards,
          > Flo
          >
          --


          ·············································
          ºvº SL_day# 331 - created 2009.11.27_23.31.19

          The same hammer that breaks the glass forges the steel.
          • Russian Proverb

          € hrs € hsavage € pobox € com
        Your message has been successfully submitted and would be delivered to recipients shortly.