September 15, 2009 · News

I figured out the adj question. We were indeed being led astray by the similarity between “adj” and “adv”. We should have been looking at the simlilarity between “adv” and “v”. When we use a regular expression like (adj|v). on the string “quickly, adv.”, we see that the string does contain “v.”. However, the string does not contain ” v.”

Written by Robert Felty


3 Comments to “Adjectives and Adverbs”

  1. cecilm says:

    Did you mean to say: the string does contain “v”. However the string does not contain “adj.”?

    • robfelty says:

      No. I meant what I said. Another example:
      echo "quickly, adv." | grep -E '(adj|n|v)\.'
      This matches, which might lead you to believe that that the presence of adj in your regular expression is the reason. However, it is the presence of v

      Compare with:
      echo "quickly, adv." | grep -E ' (adj|n|v)\.'
      This does not match, because we are looking for a space followed by either adj., n., or v.. The space is necessary.

  2. cecilm says:

    ah, I didn’t see the space in the last ” v.”

Leave a Reply

You must be logged in to post a comment.

Subscribe without commenting