Zipfs-Law-Language-Detector/ctest/test.c

37 lines
950 B
C

#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include "./zipfs-ld.h"
#include <stdlib.h>
int main(){
char* languages[] = {"sv", "en", "de", "nl"};
char* test_string = " De vragen en manier waarop ze zijn opgesteld, zijn een nieuw niveau van slecht. . ";
uint64_t language_count = 3;
bool worked = false;
uint64_t length_output;
char** result;
float* float_result;
int i;
for (i = 0; i != 10; i++){
zipfs_language_detector(
languages,
language_count,
test_string,
&worked,
&length_output,
&float_result,
&result
);
int s = 0;
for (s = 0; s != length_output+1; s++){
printf("%s\n", result[s]);
printf("%f\n", float_result[s]);
free(result[s]);
printf("s: %i\n", s);
};
free(result);
free(float_result);
}
}