Comments on: Homework 2 – More UNIX basics and regular expressions http://robfelty.com/teaching/ling5200Fall2009/2009/09/homework-2-more-unix-basics-and-regular-expressions/ Introduction to computational corpus linguistics Mon, 16 Nov 2009 18:31:36 -0500 http://wordpress.org/?v=2.9-rare hourly 1 By: robfelty http://robfelty.com/teaching/ling5200Fall2009/2009/09/homework-2-more-unix-basics-and-regular-expressions/comment-page-1/#comment-12 robfelty Fri, 11 Sep 2009 19:47:27 +0000 http://robfelty.com/teaching/ling5200Fall2009/2009/09/homework-2-more-unix-basics-and-regular-expressions/#comment-12 You should limit your search to only the orthography of the words. You should limit your search to only the orthography of the words.

]]>
By: kelleya http://robfelty.com/teaching/ling5200Fall2009/2009/09/homework-2-more-unix-basics-and-regular-expressions/comment-page-1/#comment-11 kelleya Fri, 11 Sep 2009 19:03:39 +0000 http://robfelty.com/teaching/ling5200Fall2009/2009/09/homework-2-more-unix-basics-and-regular-expressions/#comment-11 Hi Rob, For question 7 I'm able to limit my search to words that contain 'q' not followed by 'u' but when printing just the orthography I'm getting all words that have a string of q not followed by u somewhere in the definition or description. i.e. "gendarme" is one of the words in the printed list, for which in its full entry is: 36631\gendarme\13\18700\6\'Zqn-d#m\[CVVC][CVVC]\[ZA~:n][dA:m]\Zandarm\3.6667.0000\HML\Z'an<d`arm since "Zqn" fits the criteria of my search. Is this ok or do I need to get my pipeline to only print words from the entries? Thanks, Arrick Hi Rob,

For question 7 I’m able to limit my search to words that contain ‘q’ not followed by ‘u’ but when printing just the orthography I’m getting all words that have a string of q not followed by u somewhere in the definition or description.
i.e. “gendarme” is one of the words in the printed list, for which in its full entry is:
36631\gendarme\13\18700\6\’Zqn-d#m\[CVVC][CVVC]\[ZA~:n][dA:m]\Zandarm\3.6667.0000\HML\Z’an<d`arm

since "Zqn" fits the criteria of my search. Is this ok or do I need to get my pipeline to only print words from the entries?

Thanks,
Arrick

]]>
By: robfelty http://robfelty.com/teaching/ling5200Fall2009/2009/09/homework-2-more-unix-basics-and-regular-expressions/comment-page-1/#comment-10 robfelty Fri, 11 Sep 2009 16:07:16 +0000 http://robfelty.com/teaching/ling5200Fall2009/2009/09/homework-2-more-unix-basics-and-regular-expressions/#comment-10 Backslash will not escape single or double quotes. You have two options, 1. use double quotes, e.g. grep "don't" file 2. Don't use any quotes, but then you have to escape every special character grep d\[ao\]n\'t celex.txt Then to actually match special characters, you have to double escape them. e.g. grep CVVCC\\]\\[CVVC celex.txt All that having been said, it might be easier to use a negative character class. Backslash will not escape single or double quotes. You have two options,
1. use double quotes, e.g.
grep “don’t” file
2. Don’t use any quotes, but then you have to escape every special character
grep d\[ao\]n\’t celex.txt
Then to actually match special characters, you have to double escape them. e.g.
grep CVVCC\\]\\[CVVC celex.txt

All that having been said, it might be easier to use a negative character class.

]]>
By: keith.mertz http://robfelty.com/teaching/ling5200Fall2009/2009/09/homework-2-more-unix-basics-and-regular-expressions/comment-page-1/#comment-9 keith.mertz Fri, 11 Sep 2009 15:29:31 +0000 http://robfelty.com/teaching/ling5200Fall2009/2009/09/homework-2-more-unix-basics-and-regular-expressions/#comment-9 Does the backslash properly function as an escape character for the single quote mark, or must I (if even possible) use some other sorcery to grep for, say, a possessive? When I use a regular expression such as '^[A-Z\']*' in the hopes of capturing something like "HUGH'S", the terminal just stares back at me with eyes glazed and spittle dribbling down its chin. I feel like this had to have been mentioned, so I apologize (if so) for asking again. Thanks in advance for enlightenment! Does the backslash properly function as an escape character for the single quote mark, or must I (if even possible) use some other sorcery to grep for, say, a possessive? When I use a regular expression such as ‘^[A-Z\']*’ in the hopes of capturing something like “HUGH’S”, the terminal just stares back at me with eyes glazed and spittle dribbling down its chin.

I feel like this had to have been mentioned, so I apologize (if so) for asking again. Thanks in advance for enlightenment!

]]>
By: robfelty http://robfelty.com/teaching/ling5200Fall2009/2009/09/homework-2-more-unix-basics-and-regular-expressions/comment-page-1/#comment-6 robfelty Wed, 09 Sep 2009 19:15:57 +0000 http://robfelty.com/teaching/ling5200Fall2009/2009/09/homework-2-more-unix-basics-and-regular-expressions/#comment-6 Les, Here is an example. cat n., a furry domesticated animal of the feline family "cat" is the entry. Everything after the comma is the definition Look at the last example in the GREP chapter of the notes for an example. I will also go over this in class tomorrow. Les,

Here is an example.
cat n., a furry domesticated animal of the feline family

“cat” is the entry. Everything after the comma is the definition

Look at the last example in the GREP chapter of the notes for an example. I will also go over this in class tomorrow.

]]>
By: sikos http://robfelty.com/teaching/ling5200Fall2009/2009/09/homework-2-more-unix-basics-and-regular-expressions/comment-page-1/#comment-5 sikos Wed, 09 Sep 2009 16:38:05 +0000 http://robfelty.com/teaching/ling5200Fall2009/2009/09/homework-2-more-unix-basics-and-regular-expressions/#comment-5 Hi Rob, Not sure what you mean by "entries (not definitions". Is there a readme that goes along with this file? Les Hi Rob,
Not sure what you mean by “entries (not definitions”. Is there a readme that goes along with this file?
Les

]]>