Difference: EmilyDickinsonExperiment (1 vs. 5)

Revision 52019-02-11 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="IntroToCSF2018"
Changed:
<
<

Emily Dickinson Experiment

>
>

Emily Dickinson Experiment (Part 1)

 
Changed:
<
<
1. Lets' read some poety, and see what we can do...
>
>
Moodle

Due Feb 14, 11:55 pm

You will turn in Repl.it links for 2, 7, 8

1. Lets' read some poetry, and see what we can do...

  https://repl.it/@JimSkon/EmilyDickinson1
Line: 32 to 37
  8. Can you find and display all the lines that have a repeated word? Can you include the word, and the number of occurances in the line for each repeated word?
Changed:
<
<
9. What would it take to create a list of all of the unique words and write them to a file, one word per line? Try it.

10. Comment your code and thurn it in.

>
>
9. What would it take to create a list of all of the unique words and write them to a file, one word per line? More on this tonight!
  Solutions \ No newline at end of file

Revision 42019-02-09 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="IntroToCSF2018"

Emily Dickinson Experiment

Changed:
<
<
Lets read some poety, and see what we can do...
>
>
1. Lets' read some poety, and see what we can do...
 
Changed:
<
<
https://repl.it/@JimSkon/EmilyDickinson
>
>
https://repl.it/@JimSkon/EmilyDickinson1
 
Changed:
<
<
1. What if we search for "see"? How about "see;"? How about "say", "say,', "Say", and "Say,"? what chould we do about that
>
>
2. Could we count the number of times each vowel is used?
 
Changed:
<
<
2. Use the code from #1 to count the "was", and "was,". Why is there a difference? Consider the code below:
>
>
3. Can we break the lines into words?
 
Changed:
<
<

%CODE{"python"}%
>
>
https://repl.it/@JimSkon/EmilyDickinson2

4. Can we make a function countWords(word) to ask for a word and then count it?

5. What if we search for "see"? How about "see;"? How about "say", "say,', "Say", and "Say,"? What could we do about this?

6. Use the code from #3 to count the "was", and "was,". Why is there a difference? Consider the code below:

%CODE{"python"}%

 def removePunctuation(s): import string for c in string.punctuation:
Line: 18 to 26
  return s %ENDCODE%
Changed:
<
<
What does this do? Call this on every line and search for "was" now?

3. Consider the function s.lower(), where s is a string. What does it do? How might this be useful in the find repeated word code?

>
>
What does this code do? Call this on every line and search for "was". What changed?
 
Changed:
<
<
4. Can you make the program count the number of occurences of a word?
>
>
7. Consider the function s.lower(), where s is a string. What does it do? How might this be useful to counts words?
 
Changed:
<
<
5. Can you find and display all the lines that have a repeated word? Can you include the word, and the number of occurances in the line for ech repeated word?
>
>
8. Can you find and display all the lines that have a repeated word? Can you include the word, and the number of occurances in the line for each repeated word?
 
Changed:
<
<
6. What would it take to create a list of all words, and the number of occurances?
>
>
9. What would it take to create a list of all of the unique words and write them to a file, one word per line? Try it.
 
Changed:
<
<
7. Could we count the number of times each vowel is used?
>
>
10. Comment your code and thurn it in.
  Solutions \ No newline at end of file

Revision 32018-10-02 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="IntroToCSF2018"

Emily Dickinson Experiment

Line: 10 to 10
  2. Use the code from #1 to count the "was", and "was,". Why is there a difference? Consider the code below:
Changed:
<
<

<-- SyntaxHighlightingPlugin -->
<br />def removePunctuation(s):<br />  import string<br />  for c in string.punctuation:<br />    s= s.replace(c,"")<br />  return s<br />
<-- end SyntaxHighlightingPlugin -->
>
>

<-- SyntaxHighlightingPlugin -->
def removePunctuation(s):
  import string
  for c in string.punctuation:
    s= s.replace(c,"")
  return s
<-- end SyntaxHighlightingPlugin -->
  What does this do? Call this on every line and search for "was" now?

Revision 22018-10-02 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="IntroToCSF2018"

Emily Dickinson Experiment

Line: 6 to 6
  https://repl.it/@JimSkon/EmilyDickinson
Changed:
<
<
1. Can you make the program count the number of occurences of a word?
>
>
1. What if we search for "see"? How about "see;"? How about "say", "say,', "Say", and "Say,"? what chould we do about that
 
Changed:
<
<
2. Can you print out the lines which have a given word on it?
>
>
2. Use the code from #1 to count the "was", and "was,". Why is there a difference? Consider the code below:
 
Changed:
<
<
3. Can you find and display all the lines that have a repeated word?

4. Use the code from #1 to count the "was", and "was,". Why is there a difference? Consider the code below:

<-- SyntaxHighlightingPlugin -->
def removePunctuation(s):
  import string
  for c in string.punctuation:
    s= s.replace(c,"")
  return s
<-- end SyntaxHighlightingPlugin -->
>
>

<-- SyntaxHighlightingPlugin -->
<br />def removePunctuation(s):<br />  import string<br />  for c in string.punctuation:<br />    s= s.replace(c,"")<br />  return s<br />
<-- end SyntaxHighlightingPlugin -->
  What does this do? Call this on every line and search for "was" now?
Changed:
<
<
5. Consider the function s.lower(), where s is a string. What does it do? How might this be useful in the find repeated word code?
>
>
3. Consider the function s.lower(), where s is a string. What does it do? How might this be useful in the find repeated word code?

4. Can you make the program count the number of occurences of a word?

5. Can you find and display all the lines that have a repeated word? Can you include the word, and the number of occurances in the line for ech repeated word?

6. What would it take to create a list of all words, and the number of occurances?

 
Changed:
<
<
6. What would it take to create a list of all word, and the number of occurances?
>
>
7. Could we count the number of times each vowel is used?
  Solutions

Revision 12018-09-29 - JimSkon

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="IntroToCSF2018"

Emily Dickinson Experiment

Lets read some poety, and see what we can do...

https://repl.it/@JimSkon/EmilyDickinson

1. Can you make the program count the number of occurences of a word?

2. Can you print out the lines which have a given word on it?

3. Can you find and display all the lines that have a repeated word?

4. Use the code from #1 to count the "was", and "was,". Why is there a difference? Consider the code below:

<-- SyntaxHighlightingPlugin -->
def removePunctuation(s):
  import string
  for c in string.punctuation:
    s= s.replace(c,"")
  return s
<-- end SyntaxHighlightingPlugin -->

What does this do? Call this on every line and search for "was" now?

5. Consider the function s.lower(), where s is a string. What does it do? How might this be useful in the find repeated word code?

6. What would it take to create a list of all word, and the number of occurances?

Solutions

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback