同步操作将从 JoyPoint/StudyStudio 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<!DOCTYPE html><!-- word_table.phpUses a function to split a given string of text intoits constituant words. It also determines the frequency ofoccurrence of each word. The words are separated by whitespaceor punctuation, possibly followed by whitespace. Thepunctuation can be a period, a comma, a semicolon, a colon,an exclamation point, or a questionmark.The main driver program calls the function and displaysthe results.--><html lang = "en"><head><title> word_table.php </title><meta charset = "utf-8" /></head><body><?php// Function splitter// Parameter: a string of text containing words and punctuation// Returns: an array in which the unique words of the string are// the keys and their frequencies are the values.function splitter($str) {// Create the empty word frequency array$freq = array();// Split the parameter string into words$words = preg_split("/[ .,;:!?]\s*/", $str);// Loop to count the words (either increment or initialize to 1)foreach ($words as $word) {$keys = array_keys($freq);if(in_array($word, $keys))$freq[$word]++;else$freq[$word] = 1;}return $freq;} #** End of splitter// Main test driver$str = "apples are good for you, or don't you like apples?or maybe you like oranges better than apples";// Call splitter$tbl = splitter($str);// Display the words and their frequenciesprint "<br /> Word Frequency <br /><br />";$sorted_keys = array_keys($tbl);sort($sorted_keys);foreach ($sorted_keys as $word)print "$word$tbl[$word] <br />";?></body></html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。