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

RE: [Clip] Re: Help with Math

Expand Messages
  • John Shotsky
    Sheri, The moment I read that, I realized you were right. I was in a dumb loop and probably would never have found it. DUH! I changed them, and all works as
    Message 1 of 21 , Sep 20, 2008
    • 0 Attachment
      Sheri,

      The moment I read that, I realized you were right. I was in a 'dumb loop' and probably would never have found it. DUH!

      I changed them, and all works as expected now.

      THANK YOU!

      John

      From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of Sheri
      Sent: Saturday, September 20, 2008 7:53 AM
      To: ntb-clips@yahoogroups.com
      Subject: Re: [Clip] Re: Help with Math

      John Shotsky wrote:
      > ^!If ^$GetRow$=^$GetTextLineCount$ End
      >
      There's your problem.

      Change that to:

      ^!If ^$GetRow$=^$GetTextLineCount$ EndLoop70

      and all should be well.

      Regards,
      Sheri



      [Non-text portions of this message have been removed]
    • Sheri
      ... You re welcome! I d suggest to make a habit to use ^!Setdebug on to single step through clips with issues. In this case you would have been able to see
      Message 2 of 21 , Sep 20, 2008
      • 0 Attachment
        --- In ntb-clips@yahoogroups.com, "John Shotsky" <jshotsky@...> wrote:
        >
        > Sheri,
        >
        > The moment I read that, I realized you were right. I was in a
        > 'dumb loop' and probably would never have found it. DUH!
        > I changed them, and all works as expected now.
        >
        > THANK YOU!
        >
        > John
        >

        You're welcome!

        I'd suggest to make a habit to use

        ^!Setdebug on

        to single step through clips with issues. In this case you would have
        been able to see that the last line processed was not the one you
        thought. In conjunction with that, I recommend using my color
        highlighting clips (posted in the clip group's File area on Yahoo).
        Then you can be single stepping in NoteTab, while also viewing a line
        numbered, highlighted listing of that clip in a tiled browser window.

        Regards,
        Sheri
      • John Shotsky
        Thanks for those tips.I ll definitely give that a try, as my clips are now beginning to become a little more tricky. The library of clips that processes those
        Message 3 of 21 , Sep 20, 2008
        • 0 Attachment
          Thanks for those tips.I'll definitely give that a try, as my clips are now beginning to become a little more tricky. The library of
          clips that processes those recipes is now over 7000 lines long. It unscrambles text from OCR, and prepares them to be processed into
          a recipe management system. I usually develop with only a single function in its own clip until it works, then put it into the
          larger library, which I did with this one after your assistance made the errors go away.

          Thanks again,
          John

          From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of Sheri
          Sent: Saturday, September 20, 2008 10:43 AM
          To: ntb-clips@yahoogroups.com
          Subject: [Clip] Re: Help with Math

          --- In ntb-clips@yahoogroups.com <mailto:ntb-clips%40yahoogroups.com> , "John Shotsky" <jshotsky@...> wrote:
          >
          > Sheri,
          >
          > The moment I read that, I realized you were right. I was in a
          > 'dumb loop' and probably would never have found it. DUH!
          > I changed them, and all works as expected now.
          >
          > THANK YOU!
          >
          > John
          >

          You're welcome!

          I'd suggest to make a habit to use

          ^!Setdebug on

          to single step through clips with issues. In this case you would have
          been able to see that the last line processed was not the one you
          thought. In conjunction with that, I recommend using my color
          highlighting clips (posted in the clip group's File area on Yahoo).
          Then you can be single stepping in NoteTab, while also viewing a line
          numbered, highlighted listing of that clip in a tiled browser window.

          Regards,
          Sheri



          [Non-text portions of this message have been removed]
        • Sheri
          ... I used to use NoteTab to format recipes from OCR and a variety of texts (including texts from newspaper archives) for import into MasterCook, so believe me
          Message 4 of 21 , Sep 20, 2008
          • 0 Attachment
            --- In ntb-clips@yahoogroups.com, "John Shotsky" <jshotsky@...> wrote:
            >
            > Thanks for those tips.I'll definitely give that a try, as my
            > clips are now beginning to become a little more tricky. The
            > library of clips that processes those recipes is now over 7000
            > lines long. It unscrambles text from OCR, and prepares them to be
            > processed into a recipe management system. I usually develop with
            > only a single function in its own clip until it works, then put
            > it into the larger library, which I did with this one after your
            > assistance made the errors go away.
            > Thanks again,
            > John
            >

            I used to use NoteTab to format recipes from OCR and a variety of
            texts (including texts from newspaper archives) for import into
            MasterCook, so believe me when I say I know how that goes.
            Unfortunately, when I was into it, it was before NoteTab version 5 and
            PCRE. Manipulated such texts with the old regex engine was a real pain!

            Regards,
            Sheri
          • Jeff Scism
            You have clips that fix what the OCR scrambles? ... -- Jeffery G. Scism, IBSSG In the next place, the state governments are, by the very theory of the
            Message 5 of 21 , Sep 20, 2008
            • 0 Attachment
              You have clips that fix what the OCR scrambles?

              Sheri wrote:
              > --- In ntb-clips@yahoogroups.com, "John Shotsky" <jshotsky@...> wrote:
              >
              >> Thanks for those tips.I'll definitely give that a try, as my
              >> clips are now beginning to become a little more tricky. The
              >> library of clips that processes those recipes is now over 7000
              >> lines long. It unscrambles text from OCR, and prepares them to be
              >> processed into a recipe management system. I usually develop with
              >> only a single function in its own clip until it works, then put
              >> it into the larger library, which I did with this one after your
              >> assistance made the errors go away.
              >> Thanks again,
              >> John
              >>
              >>
              >
              > I used to use NoteTab to format recipes from OCR and a variety of
              > texts (including texts from newspaper archives) for import into
              > MasterCook, so believe me when I say I know how that goes.
              > Unfortunately, when I was into it, it was before NoteTab version 5 and
              > PCRE. Manipulated such texts with the old regex engine was a real pain!
              >
              > Regards,
              > Sheri
              >
              >
              >
              >


              --

              Jeffery G. Scism, IBSSG



              "In the next place, the state governments are, by the very theory
              of the constitution, essential constituent parts of the general
              government. They can exist without the latter, but the latter
              cannot exist without them."

              -- Joseph Story (Commentaries on the Constitution, 1833)

              Reference: Story, Commentaries on the Constitution, 191.
            • Sheri
              ... I remember using mostly various spell checkers for that. What got scrambled varied alot depending on the scanner, software, and source/font. Regards, Sheri
              Message 6 of 21 , Sep 20, 2008
              • 0 Attachment
                Jeff Scism wrote:
                > You have clips that fix what the OCR scrambles?
                >
                I remember using mostly various spell checkers for that. What got
                scrambled varied alot depending on the scanner, software, and source/font.

                Regards,
                Sheri
              • John Shotsky
                Jeff, Yes. I’m importing into MasterCook and Living Cookbook. I scan books and magazines, OCR them, then run my NoteTab clips on them. In the process of
                Message 7 of 21 , Sep 20, 2008
                • 0 Attachment
                  Jeff,

                  Yes.

                  I’m importing into MasterCook and Living Cookbook. I scan books and magazines, OCR them, then run my NoteTab clips on them. In the
                  process of unwinding the OCR, it places tags into the text, for the next tool to use to convert the text to xml that can be read by
                  the recipe managers.

                  FYI – in case someone wants to see what I’m up to….
                  Here’s an example of a single recipe. The Input is exactly as it comes from OmniPage Pro OCR. I save the output as plain text with
                  line breaks. The Output sample is after running a single clip on it, which calls subroutine clips. No manual editing has been
                  performed. You will see in the after where the Yield:: and Servings:: tags that I’ve just finished fit into the scheme. I also have
                  another piece that reads a csv file and automatically populates the magazine issue, page number, copyright, article name, author and
                  category with their respective tags.

                  I’m only showing one recipe, but it will take thousands at one time, including the scanned photos, if they are present. I typically
                  do about 75 at a time. What used to take me hours (span of days) now takes a few seconds. The point of all this is to make sure each
                  item ‘fits’ where the recipe management tool expects it to be, so that it can properly calculate nutrition, and so it will export
                  properly for use by others. Now if I could only replace mixed case text with upper, title, capitalized or lower case within my
                  clips. Something like ‘Replace [find string] >> Uppercase$1.

                  I began writing clips earlier this year, after tiring of the manual editing I was doing. It has been fun, but sometimes I get stuck
                  and just can’t see what I’m doing wrong. Thanks to those in this group for helping me out. I’ve learned a lot from you. Many of my
                  clips could be improved, and when I learn new things I often go back and incorporate them.

                  John

                  Before: (all lines end with CR in the Before section.)
                  BIZCOCHITOS
                  These sugar cookies are spiced with anise seeds,
                  which lend them a mild licorice flavor.
                  ¼ cup plus 1 tablespoon margarine, softened
                  ¾ cup plus 2 teaspoons sugar, divided
                  1 egg
                  1 teaspoon vanilla extract
                  1¾ cups sifted cake flour
                  2 teaspoons anise seeds
                  1 teaspoon baking powder
                  1/8 teaspoon salt
                  ½ teaspoon ground cinnamon
                  Cream margarine; gradually add 3/4 cup sugar,
                  beating at medium speed of an electric mixer until
                  mixture is light and fluffy. Add egg and vanilla, and
                  beat well. Combine cake flour and next 3 ingredi-
                  ents, and add to the creamed mixture, stirring until
                  well combined.
                  Shape dough into a ball, and wrap in heavy-duty
                  plastic wrap. Freeze 40 minutes.
                  Remove plastic wrap; roll dough to a 1/16-inch
                  thickness on a lightly floured surface. Cut with a
                  2-inch round cutter; place on cookie sheets. Com-
                  bine remaining 2 teaspoons sugar and cinnamon;
                  sprinkle on top of cookies. Bake at 350° for 10 min-
                  utes. Cool on wire racks. Store in an airtight con-
                  tainer. Yield: 4 dozen (serving size: 1 cookie) .
                  CALORIES 40 (29% from fat) / PROTEIN 0.5g / FAT 1.3g (SAT 0.3g, MONO
                  0.6g, POLY 0.4g) / CARB 6.5g / FIBER 0g / CHOL 5mg / IRON 0.4mg / SODIUM
                  28mg / CALCIUM 6mg

                  After:
                  [[[
                  Title::
                  BIZCOCHITOS
                  IM:: BIZCOCHITOS.JPG <-This permits loading the scanned photo automatically with the cookbook import.
                  Note:: These sugar cookies are spiced with anise seeds, which lend them a mild licorice flavor.
                  Ing::
                  1/4 cup margarine, softened -- PLUS
                  1 tablespoon margarine, softened
                  3/4 cup sugar -- PLUS
                  2 teaspoons sugar, divided
                  1 egg
                  1 teaspoon vanilla extract
                  1 3/4 cups sifted cake flour
                  2 teaspoons anise seeds
                  1 teaspoon baking powder
                  1/8 teaspoon salt
                  1/2 teaspoon ground cinnamon

                  Dir::
                  Cream margarine; gradually add 3/4 cup sugar, beating at medium speed of an electric mixer until mixture is light and fluffy. Add
                  egg and vanilla, and beat well. Combine cake flour and next 3 ingredients, and add to the creamed mixture, stirring until well
                  combined.

                  Shape dough into a ball, and wrap in heavy-duty plastic wrap. Freeze 40 minutes.

                  Remove plastic wrap; roll dough to a 1/16-inch thickness on a lightly floured surface. Cut with a 2-inch round cutter; place on
                  cookie sheets. Combine remaining 2 teaspoons sugar and cinnamon; sprinkle on top of cookies. Bake at 350° for 10 minutes. Cool on
                  wire racks. Store in an airtight container.

                  Yield: 4 dozen (serving size: 1 cookie).
                  Yield:: 48 cookies
                  Servings:: 48

                  Nut::
                  CALORIES 40 (29% from fat) / PROTEIN 0.5g / FAT 1.3g (SAT 0.3g, MONO 0.6g, POLY 0.4g) / CARB 6.5g / FIBER 0g / CHOL 5mg / IRON 0.4mg
                  / SODIUM 28mg / CALCIUM 6mg

                  ]]]

                  From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of Jeff Scism
                  Sent: Saturday, September 20, 2008 1:22 PM
                  To: ntb-clips@yahoogroups.com
                  Subject: Re: [Clip] Re: Help with Math

                  You have clips that fix what the OCR scrambles?

                  Sheri wrote:
                  > --- In ntb-clips@yahoogroups.com <mailto:ntb-clips%40yahoogroups.com> , "John Shotsky" <jshotsky@...> wrote:
                  >
                  >> Thanks for those tips.I'll definitely give that a try, as my
                  >> clips are now beginning to become a little more tricky. The
                  >> library of clips that processes those recipes is now over 7000
                  >> lines long. It unscrambles text from OCR, and prepares them to be
                  >> processed into a recipe management system. I usually develop with
                  >> only a single function in its own clip until it works, then put
                  >> it into the larger library, which I did with this one after your
                  >> assistance made the errors go away.
                  >> Thanks again,
                  >> John
                  >>
                  >>
                  >
                  > I used to use NoteTab to format recipes from OCR and a variety of
                  > texts (including texts from newspaper archives) for import into
                  > MasterCook, so believe me when I say I know how that goes.
                  > Unfortunately, when I was into it, it was before NoteTab version 5 and
                  > PCRE. Manipulated such texts with the old regex engine was a real pain!
                  >
                  > Regards,
                  > Sheri
                  >
                  >
                  >
                  >

                  --

                  Jeffery G. Scism, IBSSG

                  "In the next place, the state governments are, by the very theory
                  of the constitution, essential constituent parts of the general
                  government. They can exist without the latter, but the latter
                  cannot exist without them."

                  -- Joseph Story (Commentaries on the Constitution, 1833)

                  Reference: Story, Commentaries on the Constitution, 191.



                  [Non-text portions of this message have been removed]
                • Sheri
                  ... Which program is that? ... That can be done with PowerPro. Like NoteTab, PowerPro uses PCRE. Possibly at the end of processing, your clip would save
                  Message 8 of 21 , Sep 21, 2008
                  • 0 Attachment
                    --- In ntb-clips@yahoogroups.com, "John Shotsky" <jshotsky@...> wrote:

                    > The double [::] is a 'tag' that another program uses to extract
                    > data from this data file after the clip runs on it.

                    Which program is that?

                    > Now if I could only replace mixed case text with upper, title,
                    > capitalized or lower case within my clips. Something like
                    > `Replace [find string] >> Uppercase$1.

                    That can be done with PowerPro. Like NoteTab, PowerPro uses PCRE.
                    Possibly at the end of processing, your clip would save results to a
                    file (or put the file text on the clipboard), and then the clip would
                    run a short PowerPro script to do those remaining Replace-All items
                    (either from reading a file or the clipboard). Though mostly similar
                    to NoteTab's replacement processing, PowerPro has a few enhancements.
                    Powerpro's regex replacement tokens can use T, L or U in front of a
                    substring (for title, lower or upper case), e.g., "$T1". It also has
                    the replacement token "$#", for sequential numbering.

                    There is some info and data for PowerPro described here:

                    <http://tech.groups.yahoo.com/group/ntb-clips/files/CustomClipkeysInfo.html>

                    Please send any questions or followup to the ntb-OffTopic group.

                    Regards,
                    Sheri
                  Your message has been successfully submitted and would be delivered to recipients shortly.