[Package Index | Mudlib Index | Effect Index]
Written by Shaggy This handler is a collection of methods that attempt to evaluate how much like english a line of text is. Some tests might be more expensive than others but the general idea is to be much cheaper than a dictionary lookup. The general principle it to return a value that is closer to 100 the better the english with 50 being borderline (ie. likely to be gibberish). The returned value is thus a bit like a percentage chance that it is english.
int FreqTest(string line)
"/obj/handlers/english_handler"->FreqTest("Short english sentence") Returns: 75
"/obj/handlers/english_handler"->FreqTest("Sqeal spezzial sentenz") Returns: 1
"/obj/handlers/english_handler"->FreqTest("eeeeeeee dfs fsfdsfddf") Returns: 37
"/obj/handlers/english_handler"->FreqTest("too short"); Returns: 59
"/obj/handlers/english_handler"->FreqTest("Don't like l33t sp33k neither"); Returns: 36
"/obj/handlers/english_handler"->FreqTest("a small excursion to the zoo should be permissible"); Returns: 83
string * get_words(string category)
string *words; words = ("/obj/handlers/english_handler")->get_words( "greetings", 1 ); if( sizeof( words ) ) { add_respond_to_with( ({ "@say", words }), "greet $hname$" ); }
int ProfaneTest(string strin)
string * query_word_categories()
void set_words()