#!/usr/bin/tclsh

#   "speed_demo.tcl" - part of "RAGMAAN, een anagrammengenerator" 
#
#            Copyright (C) 1999 Raymond Zandbergen
#
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#    The maintainer of this program is Raymond Zandbergen (ray@wirehub.nl)
#
#
#
# load the package
#

load ../lib/librm.so.1.1.0

#
#  load the database
#

rm_load_words ../nl.txt

#
#  init test search for my name, minimum word length is 3
#

set test_id [rm_init_search raymondzandbergen 1]

#
#  perform the search , store the first 100000 results (i.e. all )
#  in $anagrams
#

set anagrams [rm_search $test_id 100000]

#
#  count the results
#

set nof_anagrams [llength $anagrams]

puts $anagrams

puts "\"\$anagrams\" contains $nof_anagrams words"
