#include <string>
#include <map>
#include <vector>
#include "db.h"
#include "config.h"
Go to the source code of this file.
Data Structures | |
struct | res_stat |
This structure contains statistics about found prefixes. More... | |
Typedefs | |
typedef std::map< std::string, res_stat > | results |
List of found prefixes. | |
Functions | |
results * | find_it (db *stats, const char *file, const char *condition, const char *statsstr, bool suffix=false) |
Prefix recognition itself. | |
void | print_it (results *what, const char *where, const char *format, unsigned int app) |
Prints results. Nothing interesting. |
This module contains main recognition and printout function. Recognition function tries to recognize as many prefixes as it can and store results in structure used by printout function. Recognition is done by evaluating expression provided by user.
List of found prefixes.
First item in the map is prefix itself. Second item represent some statistics about this prefix and informations, why do we think this is a prefix.
results* find_it | ( | db * | stats, | |
const char * | file, | |||
const char * | condition, | |||
const char * | statsstr, | |||
bool | suffix = false | |||
) |
Prefix recognition itself.
This function uses mentioned condition to find prefixes. Everything what seems like prefix is saved into newly created database of results with statistics specified by parameter. If there is more then one occurrence of prefix, statistics are averaged.
stats | Database with statistics. | |
file | File with datas. | |
condition | Condition on prefix. | |
statsstr | Statistics to be computed. | |
suffix | Do we want suffixes? |
References add_task(), affstring, CHECK_PTR, thread_arg::common, thread_common_arg::condition, find_it_thread(), thread_common_arg::input, thread_common_arg::prefs, thread_common_arg::stats, thread_common_arg::statsstr, thread_common_arg::suffix, VPRINTF, wait_for_empty(), and WPRINTF.
Referenced by main().