Yomguithereal / talisman

Straightforward fuzzy matching, information retrieval and NLP building blocks for JavaScript.
https://yomguithereal.github.io/talisman/
MIT License
704 stars 47 forks source link

Punkt: expose custom variables on object instances #155

Closed mikehenrty closed 6 years ago

mikehenrty commented 6 years ago

I was very excited to discover this JS implementation of Punkt. Thanks for building it!

Using your library I'd like to do the following, but it seems the current implementation won't allow configuring custom variables:

# In Python...
trainer = PunktTrainer()
trainer.INCLUDE_ALL_COLLOCS = True
trainer.train(text)

I think a good way to conform to the original python API would be to expose these on the instance objects in the constructor. I've taken a shot at this in the PR. Let me know what you think.

Yomguithereal commented 6 years ago

Thanks @mikehenrty. This is not my preferred solution but it's good enough so I think I will merge. My original intention was to make all this more JavaScripty in feel but I did not find the time.

Yomguithereal commented 6 years ago

Do you need a release on npm?

mikehenrty commented 6 years ago

Do you need a release on npm?

Yes please :)

Thanks again @Yomguithereal !

Yomguithereal commented 6 years ago

v0.21.0 is now published.

mikehenrty commented 6 years ago

cheers