zrustest.c
author viric@llimona
Sat, 01 Sep 2007 01:19:18 +0200
changeset 16 b4e251400e36
permissions -rw-r--r--
Improved hash on zprocess, and added parsing for "jo".
#include <stdio.h>
#include "dictre.h"

int main()
{
    char in[MAXWORD];
    enum Case vcase[MAXWORD];
    char tmp[MAXWORD];
    char recased[MAXWORD];
    int len;
    int i;

    printf("Insert string: ");
    fgets(in, MAXWORD, stdin);
    in[strlen(in)-1] = 0; /* Remove last '\n' */
    len = get_case(vcase, in);
    printf("Case: ");
    for(i=0; i < len; ++i)
    {
        printf("%i ", (int) vcase[i]);
    }
    putchar('\n');

    printf("Lower case: ");
    get_lowcase_str(tmp, in);
    remove_jo(tmp);
    printf("%s\n", tmp);

    printf("Reconstructed case: ");
    reapply_case(recased, tmp, vcase);
    printf("%s\n", recased);
}