zrustest.c
author viric@llimona
Sun, 02 Sep 2007 14:24:10 +0200
changeset 24 026a2ba0ce16
parent 16 b4e251400e36
permissions -rw-r--r--
Now the HTML result shows word meanings.
#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);
}