Text Analytics Library
a collection of routines for simple textual analysis
|
Routines to help analyze text input. More...
Go to the source code of this file.
Functions | |
word_list_t | split_words (FILE *is) |
extract a list of words from a stream More... | |
word_map_t | count_words (const word_list_t words) |
count occurrences of words in a list More... | |
void | sort_counted_words (word_map_t wm, int opt) |
sort a counted word list More... | |
Routines to help analyze text input.
word_map_t count_words | ( | const word_list_t | words | ) |
count occurrences of words in a list
words | a list of words |
initialization of the word_map_t structure includes dynamic memory allocation. It is the caller's responsibility to call word_map_free on the returned object when finished with it.
void sort_counted_words | ( | word_map_t | wm, |
int | opt | ||
) |
sort a counted word list
Sorts first by numerical value, then alphabetically. The sort is done "in place", i.e. the word_map_t object is modified.
wm | the word map object to sort |
opt | sort options. May be either AMAP_SORT_ASCENDING or AMAP_SORT_DESCENDING. |
word_list_t split_words | ( | FILE * | is | ) |
extract a list of words from a stream
is | input FILE stream |
initialization of the word_list_t structure includes dynamic memory allocation. It is the caller's responsibility to call word_list_free on the returned object when finished with it.