Ruby nub question: how can I convert, e.g., words in words = Ve.in(:en).words('I like melons.') to JSON?
(I need to parse thousands of sentences and I'm hoping using the native Ruby front-end will be faster than going through JavaScript and hitting Sinatra thousands of times. I'm hoping I can just cat file | ruby ve.ruby > results.txt and have each line of results.txt be a complete JSON object.)
Ruby nub question: how can I convert, e.g.,
words
inwords = Ve.in(:en).words('I like melons.')
to JSON?(I need to parse thousands of sentences and I'm hoping using the native Ruby front-end will be faster than going through JavaScript and hitting Sinatra thousands of times. I'm hoping I can just
cat file | ruby ve.ruby > results.txt
and have each line ofresults.txt
be a complete JSON object.)