#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "compute.h"
#include "helper.h"
#include "threads.h"
#include "functions.h"
#include "evaluator.h"
Data Structures | |
struct | thread_common_arg |
Thread shared arguments. More... | |
struct | thread_arg |
Thread argument. More... | |
Functions | |
void * | find_it_thread (void *arg) |
Prefix recognition itself. | |
results * | find_it (db *stats, const char *from, const char *condition, const char *statsstr, bool suffix) |
Prefix recognition itself. | |
void | print_it (results *what, const char *to, const char *format, unsigned int app) |
Prints results. | |
Variables | |
unsigned int | maxlen |
Maximal length of prefix. | |
unsigned int | minlen |
Minimal length of prefix. | |
unsigned int | longest |
Longest word from input file. | |
char * | affstring |
How do we call that thing, that we want to recognize. |
See compute.h for details.
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().
void print_it | ( | results * | what, | |
const char * | to, | |||
const char * | format, | |||
unsigned int | app | |||
) |