Created
August 7, 2019 21:30
-
-
Save mmsamiei/c63f90a22fa4acdbe89f331c7ce3ccc0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!pip install stanfordnlp | |
import stanfordnlp | |
stanfordnlp.download('fa') | |
nlp = stanfordnlp.Pipeline(processors = "tokenize", lang="fa", models_dir=".") | |
str = "برای رفتن به سمرقند باید از خانهای بیشمار گذشت" | |
doc = nlp(str) | |
for sent in doc.sentences: | |
for wrd in sent.words: | |
print(wrd.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment