Lines Matching refs:agent
16 agent = Marisa::Agent.new
18 agent.set_query("cake")
19 trie.lookup(agent)
20 print(agent.query_str(), ": ", agent.key_id(), "\n")
22 agent.set_query("cookie")
23 trie.lookup(agent)
24 print(agent.query_str(), ": ", agent.key_id(), "\n")
26 agent.set_query("cockoo")
27 if not trie.lookup(agent)
28 print(agent.query_str(), ": not found\n")
40 agent.set_query(0)
41 trie.reverse_lookup(agent)
42 print(agent.query_id(), ": ", agent.key_str(), "\n")
44 agent.set_query(1)
45 trie.reverse_lookup(agent)
46 print(agent.query_id(), ": ", agent.key_str(), "\n")
53 agent.set_query("ice-cream soda")
54 while trie.common_prefix_search(agent)
55 print(agent.query_str(), ": ", agent.key_str(), " (", agent.key_id(), ")\n")
58 agent.set_query("ic")
59 while trie.predictive_search(agent)
60 print(agent.query_str(), ": ", agent.key_str(), " (", agent.key_id(), ")\n")