initialize($use_apc=true); // Term Extractor // -------------- // Creater TermExtractor instance $extractor = new TermExtractor($tagger, $filter); // Extract terms from the text $terms = $extractor->extract($text); // We're outputting results in plain text... header('Content-Type: text/plain; charset=UTF-8'); // Loop through extracted terms and print each term on a new line foreach ($terms as $term_info) { // index 0: term // index 1: number of occurrences in text // index 2: word count list($term, $occurrence, $word_count) = $term_info; echo "$term\n"; echo " -> occurrence: $occurrence, word count: $word_count\n\n"; }