<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://lms.onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=Python%3A_cari-stopwords.py</id>
	<title>Python: cari-stopwords.py - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://lms.onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=Python%3A_cari-stopwords.py"/>
	<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=Python:_cari-stopwords.py&amp;action=history"/>
	<updated>2026-04-19T21:55:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://lms.onnocenter.or.id/wiki/index.php?title=Python:_cari-stopwords.py&amp;diff=46841&amp;oldid=prev</id>
		<title>Onnowpurbo: Created page with &quot;Install dulu   pip install nltk  Source code   import os,nltk,os.path,re,string  import argparse  from nltk.stem.porter import PorterStemmer    ps=PorterStemmer()     def hany...&quot;</title>
		<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=Python:_cari-stopwords.py&amp;diff=46841&amp;oldid=prev"/>
		<updated>2017-02-01T22:05:05Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Install dulu   pip install nltk  Source code   import os,nltk,os.path,re,string  import argparse  from nltk.stem.porter import PorterStemmer    ps=PorterStemmer()     def hany...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Install dulu&lt;br /&gt;
&lt;br /&gt;
 pip install nltk&lt;br /&gt;
&lt;br /&gt;
Source code&lt;br /&gt;
&lt;br /&gt;
 import os,nltk,os.path,re,string&lt;br /&gt;
 import argparse&lt;br /&gt;
 from nltk.stem.porter import PorterStemmer&lt;br /&gt;
 &lt;br /&gt;
 ps=PorterStemmer() &lt;br /&gt;
 &lt;br /&gt;
 def hanya_huruf( input ):&lt;br /&gt;
    r=re.match(&amp;#039;^[a-zA-Z]+$&amp;#039;, input)&lt;br /&gt;
    if r==None:&lt;br /&gt;
       return False&lt;br /&gt;
    else:&lt;br /&gt;
       return True&lt;br /&gt;
 &lt;br /&gt;
 def parse_args():&lt;br /&gt;
     parser = argparse.ArgumentParser()&lt;br /&gt;
     parser.add_argument(&amp;#039;-i&amp;#039;, &amp;#039;--infile&amp;#039;, default=&amp;#039;&amp;#039;, help=&amp;#039;input filename&amp;#039;)&lt;br /&gt;
     return parser.parse_args()&lt;br /&gt;
 &lt;br /&gt;
 args = parse_args()&lt;br /&gt;
 infile = args.infile&lt;br /&gt;
 &lt;br /&gt;
 filename = open(infile,&amp;#039;r&amp;#039;)&lt;br /&gt;
 fcontent=filename.read()&lt;br /&gt;
 filename.close()&lt;br /&gt;
 &lt;br /&gt;
 fs = fcontent.split()&lt;br /&gt;
 wordlist=[]&lt;br /&gt;
 &lt;br /&gt;
 for word in fs:&lt;br /&gt;
     if hanya_huruf(word) and len(word)&amp;lt;15 and len(word)&amp;gt;1 and word!=&amp;#039;Iing&amp;#039; :&lt;br /&gt;
        print(word)&lt;br /&gt;
        word = ps.stem(word.strip(string.punctuation).lower())&lt;br /&gt;
        if word not in nltk.corpus.stopwords.words(&amp;#039;english&amp;#039;):&lt;br /&gt;
           if word not in nltk.corpus.stopwords.words(&amp;#039;indonesia&amp;#039;):&lt;br /&gt;
               if word not in wordlist:&lt;br /&gt;
                   wordlist.append(word)&lt;br /&gt;
                   print( word )&lt;br /&gt;
               else:&lt;br /&gt;
                   pass&lt;br /&gt;
        else:&lt;br /&gt;
            pass&lt;/div&gt;</summary>
		<author><name>Onnowpurbo</name></author>
	</entry>
</feed>