Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle final periods #33

Merged
merged 3 commits into from
Jun 27, 2019
Merged

Conversation

Ayushk4
Copy link
Member

@Ayushk4 Ayushk4 commented Jun 27, 2019

Before -

julia> toktok_tokenize("This is a sentence. ")
4-element Array{String,1}:
 "This"     
 "is"       
 "a"        
 "sentence."

Now -

julia> toktok_tokenize("This is a sentence. ")
5-element Array{String,1}:
 "This"    
 "is"      
 "a"       
 "sentence"
 "."

Also, minor changes in handle_final_periods function, to prevent re-traversing over trailing spaces at the end of the string.

@oxinabox
Copy link
Member

Can you check this against the original toktok, or against the nltk toktok?
Either way I am infavor but if we are dieviating we should document that this is an enhanced version of the toktok tokenizer

@Ayushk4
Copy link
Member Author

Ayushk4 commented Jun 27, 2019

Nltk's toktok gives the following output for toktok.tokenize("This is a sentence. ")

 ['This', 'is', 'a', 'sentence.']

@oxinabox
Copy link
Member

Ok cool.
Lets add to the docstring that this is an enhanced version of the orginal toktok tokenzier

@Ayushk4 Ayushk4 merged commit cc225ea into JuliaText:master Jun 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants