Forum: Ferret testing tokenizers

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Onur T. (Guest)
on 2006-04-12 16:19
(Received via mailing list)
is there a way to test tokenizers? I mean, I want to give input stream
and see the output tokens.

AND is there a way to see an indexed document's index tokens? Which
words in the document are used to index this document?

Thanks in advance
David B. (Guest)
on 2006-04-18 05:59
(Received via mailing list)
Hey Onur, just got back from a trip around Japan. You've probably
already worked out the answer to this question but here is how I test

    require 'ferret'
    $stdin.each do |line|
      stk =
      while tk =
        puts "    <#{tk.text}> from #{tk.start_offset} to

And I run it like this;

    ruby -r rubygems tz_tester.rb < file_to_tokenize.txt

You can just change the tokenizer to whaterver tokenizer you want to

Hope that helps,
This topic is locked and can not be replied to.