<h1>In Short</h1>

<p>Your project is a little overly ambitious. </p>

<p>Also, try to ask more specific questions on Stackoverflow. Focus on a finding out what is wrong and explain what help you would require. That'll help people to help you better. </p>

<h1>In Long</h1>

<p>Let's try and break down your requirements:</p>

<blockquote>
  <p>I am trying to make a program in python that will take notes on a passage that I input. </p>
</blockquote>

<p>Not sure what that really means...</p>

<blockquote>
  <p>It will sort out the first and last sentence of the paragraph ...</p>
</blockquote>

<p>The original code in the original post (OP) doesn't have any checks on the dates/numbers. </p>

<p>First, you need to define <strong>what is a sentence?</strong></p>

<ul>
<li>What counts as sentence boundary?</li>
<li>How are you going to detect sentences from a paragraph.</li>
</ul>

<p>Perhaps, <code>nltk.sent_tokenize</code> would help:</p>

<pre><code>from nltk import sent_tokenize

text = """Gwaha-ju (과하주; 過夏酒; literally "summer-passing wine") is a traditional Korean fortified rice wine. The refined rice wine cheongju (also called yakju) is fortified by adding the distilled spirit soju to produce gwaha-ju. Gwaha-baekju was first mentioned in Sanga Yorok, a mid-15th century cookbook, but the rice wine was made without fortification. The earliest recorded recipe for fortified gangha-ju appears in Eumsik dimibang, a 1670 cookbook.  Other Joseon books that mention the fortified rice wine include Jubangmun, Chisaeng yoram, Yeokjubangmun, Eumsikbo, Sallim gyeongje, Jeungbo sallim gyeongje, Gyuhap chongseo, and Imwon gyeongjeji."""

sent_tokenize(text)
</code></pre>

<blockquote>
  <p>... and the sentences with dates and numbers. </p>
</blockquote>

<p>Hmmm.. that's how about checking for digits in the string of each sentence:</p>

<pre><code>from nltk import sent_tokenize

text = """Gwaha-ju (과하주; 過夏酒; literally "summer-passing wine") is a traditional Korean fortified rice wine. The refined rice wine cheongju (also called yakju) is fortified by adding the distilled spirit soju to produce gwaha-ju. Gwaha-baekju was first mentioned in Sanga Yorok, a mid-15th century cookbook, but the rice wine was made without fortification. The earliest recorded recipe for fortified gangha-ju appears in Eumsik dimibang, a 1670 cookbook.  Other Joseon books that mention the fortified rice wine include Jubangmun, Chisaeng yoram, Yeokjubangmun, Eumsikbo, Sallim gyeongje, Jeungbo sallim gyeongje, Gyuhap chongseo, and Imwon gyeongjeji."""

for sent in sent_tokenize(text):
    if any(ch for ch in sent if ch.isdigit()):
        print(sent)
</code></pre>

<blockquote>
  <p>It would then replace some words ... </p>
</blockquote>

<p>Then you have to define <strong>what is a word?</strong></p>

<ul>
<li>How do you define word boundary? </li>
<li>It won't be the same for different languages</li>
</ul>

<p>Maybe with <code>nltk.word_tokenize</code>, e.g.</p>

<pre><code>from nltk import sent_tokenize, word_tokenize

text = """Gwaha-ju (과하주; 過夏酒; literally "summer-passing wine") is a traditional Korean fortified rice wine. The refined rice wine cheongju (also called yakju) is fortified by adding the distilled spirit soju to produce gwaha-ju. Gwaha-baekju was first mentioned in Sanga Yorok, a mid-15th century cookbook, but the rice wine was made without fortification. The earliest recorded recipe for fortified gangha-ju appears in Eumsik dimibang, a 1670 cookbook.  Other Joseon books that mention the fortified rice wine include Jubangmun, Chisaeng yoram, Yeokjubangmun, Eumsikbo, Sallim gyeongje, Jeungbo sallim gyeongje, Gyuhap chongseo, and Imwon gyeongjeji."""

for sent in sent_tokenize(text):
    if any(ch for ch in sent if ch.isdigit()):
        print(word_tokenize(sent))
</code></pre>

<blockquote>
  <p>It would then replace some words with synonyms, </p>
</blockquote>

<p>Not sure which word you would like to replace with synonyms and which synonyms you're going to choose from. But do note that WordNet is not a exactly a good thesaurus.</p>

<p>Each word comes with different meanings and only meanings are linked in WordNet not words, see <a href="https://stackoverflow.com/a/19383914/610569">https://stackoverflow.com/a/19383914/610569</a></p>

<p>E.g. given the word "wine":</p>

<pre><code>from nltk.corpus import wordnet as wn

for synset in wn.synsets('wine'): # each meaning for the word, aka. synset
    print(synset)
    print('Words with same meaning:', synset.lemma_names(), '\n')
</code></pre>

<p><strong>How do you know which synset/meaning to use?</strong></p>

<p>That's is an open question. It's also known as the <a href="https://en.wikipedia.org/wiki/Word-sense_disambiguation" rel="nofollow noreferrer">Word Sense Disambiguation (WSD) task</a>. </p>

<p>If you just flatten and use the lemma names of all synset, the "synonyms" or replacement you want to make won't make sense. E.g. </p>

<pre><code>from itertools import chain

from nltk.corpus import wordnet as wn
from nltk import sent_tokenize, word_tokenize

text = """Gwaha-ju (과하주; 過夏酒; literally "summer-passing wine") is a traditional Korean fortified rice wine. The refined rice wine cheongju (also called yakju) is fortified by adding the distilled spirit soju to produce gwaha-ju. Gwaha-baekju was first mentioned in Sanga Yorok, a mid-15th century cookbook, but the rice wine was made without fortification. The earliest recorded recipe for fortified gangha-ju appears in Eumsik dimibang, a 1670 cookbook.  Other Joseon books that mention the fortified rice wine include Jubangmun, Chisaeng yoram, Yeokjubangmun, Eumsikbo, Sallim gyeongje, Jeungbo sallim gyeongje, Gyuhap chongseo, and Imwon gyeongjeji."""

for sent in sent_tokenize(text):
    if any(ch for ch in sent if ch.isdigit()):
        for word in word_tokenize(sent):
            lemma_names = set(chain(*[synset.lemma_names() for synset in wn.synsets(word)]))
            # If you just flatten and use the lemma names of all synset, 
            # the "synonyms" or replacement you want to make won't make sense.
            print(word, '\t', lemma_names)
</code></pre>

<blockquote>
  <p>... and get rid of useless adjectives. </p>
</blockquote>

<p>Hmmm, that'll require yet another piece of NLP process call POS tagging and it's not perfect.</p>

<p>Perhaps you can try <code>nltk.pos_tag</code> but don't expect too much of it (in terms of accuracy), e.g.</p>

<pre><code>from itertools import chain

from nltk.corpus import wordnet as wn
from nltk import sent_tokenize, word_tokenize, pos_tag

text = """Gwaha-ju (과하주; 過夏酒; literally "summer-passing wine") is a traditional Korean fortified rice wine. The refined rice wine cheongju (also called yakju) is fortified by adding the distilled spirit soju to produce gwaha-ju. Gwaha-baekju was first mentioned in Sanga Yorok, a mid-15th century cookbook, but the rice wine was made without fortification. The earliest recorded recipe for fortified gangha-ju appears in Eumsik dimibang, a 1670 cookbook.  Other Joseon books that mention the fortified rice wine include Jubangmun, Chisaeng yoram, Yeokjubangmun, Eumsikbo, Sallim gyeongje, Jeungbo sallim gyeongje, Gyuhap chongseo, and Imwon gyeongjeji."""

for sent in sent_tokenize(text):
    if any(ch for ch in sent if ch.isdigit()):

        for word, tag in pos_tag(word_tokenize(sent)):
            if not tag.startswith('JJ'): # JJ* refers to adjective.
                print(word)
        print('-----')
</code></pre>

<blockquote>
  <p>I am know the generic stuff with python, but I am new to nltk and WordNet. I've started a prototype program that will replace words in a sentence with all the random synonyms, </p>
</blockquote>

<p>Keep it up! Don't be discouraged and I think starting with the goal of building an application may not be the right place to start with NLP, try instead:</p>

<ul>
<li><a href="https://web.stanford.edu/~jurafsky/slp3/" rel="nofollow noreferrer">https://web.stanford.edu/~jurafsky/slp3/</a></li>
<li><a href="http://www.nltk.org/book/" rel="nofollow noreferrer">http://www.nltk.org/book/</a></li>
<li><a href="https://arxiv.org/abs/1510.00726" rel="nofollow noreferrer">https://arxiv.org/abs/1510.00726</a></li>
</ul>

<blockquote>
  <p>however I keep getting an error that says there is something wrong with WordNet. I think I installed it right, but I might be wrong.</p>
</blockquote>

<p>Yes, there's nothing wrong with the installation. </p>

<p>Perhaps going through the WordNet API in NLTK would help you to understand how and what WordNet can do: <a href="http://www.nltk.org/howto/wordnet.html" rel="nofollow noreferrer">http://www.nltk.org/howto/wordnet.html</a> </p>

<p>Also, improving basic Python and understanding why the <code>AttributeError</code> is occurring would help a lot =)</p>
Note Taking Program with NLTK and Wordnet doesnt work, Error message says its because of wordnet
<p>I am trying to make a program in python that will take notes on a passage that I input. It will sort out the first and last sentence of the paragraph and the sentences with dates and numbers. It would then replace some words with synonyms, and get rid of useless adjectives. I am know the generic stuff with python, but I am new to nltk and WordNet. I've started a prototype program that will replace words in a sentence with all the random synonyms, however I keep getting an error that says there is something wrong with WordNet. I think I installed it right, but I might be wrong. Here is my code:</p>

<pre><code>import random
import sys
from nltk.corpus import wordnet

print('Enter your passage')
Passage = sys.stdin.readline()
PassageList = Passage.split(' ')
wordCounter = 0
syns = []

def maxInt(list):
    i = 0
    for x in list:
    i += 1
return i



for x in PassageList:
    syns = wordnet.synsets(PassageList[wordCounter])
    synLength = maxInt(syns)
    PassageList[wordCounter] == syns[0]
    print(PassageList[wordCounter])
    wordCounter += 1
</code></pre>

<p>Here is the error I keep getting:</p>

<pre><code>Traceback (most recent call last):
  File "C:\Users\shoob\Documents\Programs\Python\Programs\NoteTake.py",   line 22, in &lt;module&gt;
    PassageList[wordCounter] == syns[0]
  File "C:\Users\shoob\AppData\Local\Programs\Python\Python36-32\lib\site-packages\nltk\corpus\reader\wordnet.py", line 198, in __eq__
    return self._name == other._name
   AttributeError: 'str' object has no attribute '_name'
</code></pre>

<p>If you can help in anyway it would help me out a lot. :-D</p>