Skip to content

Added Japanese language support. - #584

Merged
codelucas merged 3 commits into
codelucas:masterfrom
sfi-dannybrady:japanese_pr
Aug 27, 2018
Merged

Added Japanese language support.#584
codelucas merged 3 commits into
codelucas:masterfrom
sfi-dannybrady:japanese_pr

Conversation

@sfi-dannybrady

Copy link
Copy Markdown
Contributor

I've added Japanese language support. Japanese needs a new tokenizer, so tinysegmenter was used. The language code for Japanese is ja.

@codelucas codelucas left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Impressive work, thanks @sfi-dannybrady, thanks for adding the thorough unit testing and adding JP support with minimal dependencies as well. Will approve, merge and push to pypi asap

Comment thread newspaper/text.py
super(StopWordsJapanese, self).__init__(language='ja')

def candidate_words(self, stripped_input):
import tinysegmenter

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Python style recommends importing at file header. However, one advantage in doing this is that non-japanese extraction users will not import the un-needed module. But that advantage is lost anyways in this particular implementation since we force tinysegmenter install in reqs.

Comment thread requirements.txt Outdated
feedfinder2>=0.0.4
jieba3k>=0.35.1
python-dateutil>=2.5.3
tinysegmenter==0.3 No newline at end of file

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean >=0.3 ? Let's merge anyways but add a todo to change this if needed

@codelucas
codelucas merged commit 2dea009 into codelucas:master Aug 27, 2018
@codelucas

Copy link
Copy Markdown
Owner

Will deploy this in pypi after some more testing on my end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants