louismullie / treat

Natural language processing framework for Ruby.
Other
1.36k stars 128 forks source link

Custom extractors #50

Closed inem closed 11 years ago

inem commented 11 years ago

I am trying to build quick prototype of query understanding like on http://adioso.com/ using treat.

I decided to write own extractors to detect some groups of patterns. In the documentations you show how to extend Treat by adding custom stemmers & tokenizers. Is there a way to add custom extractor similarly? I had to edit gem sources to play with it, but I wish I could extend it via initializer in my rails app.

Here's what I have: https://gist.github.com/inem/5396787 This one is very primitive. I am thinking to write some extractors, who will be able to search against app database. To do so, these extractors should not be the part of treat gem definitely.

Or maybe I am doing it completely wrong way?

louismullie commented 11 years ago

This is the preferred way of adding custom extractors. You can also use the shorthand syntax as shown in the documentation.