paint-brush
Install PolyGlot on Macby@pradyumnadoddala
2,832 reads
2,832 reads

Install PolyGlot on Mac

by PradyMarch 10th, 2016
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

<span>W</span>hy PolyGlot&nbsp;?

Company Mentioned

Mention Thumbnail
featured image - Install PolyGlot on Mac
Prady HackerNoon profile picture

Why PolyGlot ?

I always have something to do with some software, because a good software engineer always uses the libraries that exists rather than recreating them.

I started working with NLP again but this time, I chose Python for my tasks, so after going to some Githubbing (I don't know if that's actually a word, here I go I’ve created a lexicon) PolyGlot seems to be a good library to do most of the NLP tasks.

Here is an installation guide (With error handling)

  • Try installing polyglot using pip

$ pip install polyglot

  • If you see an error like the below image

It means, you are missing the icu4c library.

Many OS do not provide full support for Unicode and standards-compliant text handling services and as we are dealing with NLP library which require these services.

  • First let us install the icu4c library using brew.

$ brew install icu4c

  • Check installation using

$ ls -l /usr/local/opt/icu4c/include/

Now install pyicu

$ CFLAGS=-I/usr/local/opt/icu4c/include LDFLAGS=-L/usr/local/opt/icu4c/lib pip install pyicu

Now the final command

$ pip install polyglot

References



http://polyglot.readthedocs.org/en/latest/Installation.htmlhttp://stackoverflow.com/questions/33259191/installing-libicu-dev-on-machttps://github.com/Homebrew/homebrew/issues/34170

Follow @pradyumna_d on Twitter for more..