Skip to content

Commit

Permalink
Merge branch 'master' of git@github.com:mlj/ruby-sfst
Browse files Browse the repository at this point in the history
  • Loading branch information
mlj committed Nov 6, 2008
2 parents de9e510 + f7e05e2 commit 53a0e34
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ext/sfst_machine/fst.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#include "mem.h"

typedef unsigned short VType;
typedef unsigned long VType;

extern int Quiet;

Expand Down
1 change: 0 additions & 1 deletion ext/sfst_machine/sfst_machine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,6 @@ static bool _regular_transducer_yield(Transducer *t, Node *node, VALUE result_ar

static VALUE _regular_transducer_analyze_or_generate(Transducer *t, VALUE string, bool generate)
{
t->vmark = 0;
Transducer *a2, *a3;
Transducer a1(RSTRING(string)->ptr, &(t->alphabet), false);
if (generate) {
Expand Down
12 changes: 10 additions & 2 deletions test/test_sfst.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,19 @@ def test_analyze
class StressTestCase < Test::Unit::TestCase
def setup
SFST::compile(TEST_SCRIPT_FILE, TEST_COMPILED_REGULAR_FILE, :compact => false)
SFST::compile(TEST_SCRIPT_FILE, TEST_COMPILED_COMPACT_FILE, :compact => true)
end

def test_repeated_analyses
def test_repeated_analyses_regular
fst = SFST::RegularTransducer.new(TEST_COMPILED_REGULAR_FILE)
65535.times do
65536.times do
assert_equal ['bar', 'baz'], fst.analyse('foo').sort
end
end

def test_repeated_analyses_compact
fst = SFST::CompactTransducer.new(TEST_COMPILED_COMPACT_FILE)
65536.times do
assert_equal ['bar', 'baz'], fst.analyse('foo').sort
end
end
Expand Down

0 comments on commit 53a0e34

Please sign in to comment.