words

PHP Output Words Not In String

I have two strings: $string = shell_exec('reg.bat '.$arg); //returns word\0word\0word $stringA = "$string"; $stringB = "word,other,word2,other2"; $array1 = explode('\0', $stringA); $array2 = explode(',', $stringB); $result = array_diff($array1, $array2); I can use array_diff to find the differences, but the last word shows up as not i...

Regular expression to strip everything but words

I'm helpless on regular expressions so please help me on this problem. Basically I am downloading web pages and rss feeds and want to strip everything except plain words. No periods, commas, if, ands, and buts. Literally I have a list of the most common words used in English and I also want to strip those too but I think I know how to d...

Output time as words, as in "One O'Clock PM" in PHP

Hi. I'm working on a relatively rudimentary project which requires using a text-to-speech engine to read the current time. PHP will allow me to output the current time in many ways. However, I need to output the time as words. For example, 13:00 should output as "one o'clock pm" and so forth. Another example, 01:23 should output as ...

Random word selection

Is there a way to get a random word from an online dictionary like dictionary.com, into a string for use in PHP. API's etc... Impossible or not? ...

Calculating a relative Levenshtein distance - make sense?

I am using both Daitch-Mokotoff soundexing and Damerau-Levenshtein to find out if a user entry and a value in the application are "the same". Is Levenshtein distance supposed to be used as an absolute value? If I have a 20 letter word, a distance of 4 is not so bad. If the word has 4 letters... What I am now doing is taking the distanc...

Set a certain WORD as Selected/Highlighted in WPF RichTextBox from the ViewModel ?

Hello, I have a List of items in my ViewModel. Every Item represents a Row in a DataGrid. Every Row has a column with a RichTextBox as cell editor. I am searching data in the database. The ResultViewModel has the search word And the index of the column + row in the datagrid where the searched word is located. Now I need a method in th...

PHP Word Crawler

Hi, How to get all unique words from a webpage in an array? (without all attributes and javascript etc.)? Could anybody help me with this? ...

reverse match of multiple words

Thanks for reading this. Hope you can help me. When I have a Mysql table with these row values id| search ======== 1| butterflies 2| america 3| birds of america 4| america butterflies how can I tell which rows have all the words in column 'search' occuring in the string "butterflies of america", regardless of the number or order of the...