zrustest.c
author viric@llimona
Sun, 02 Sep 2007 15:59:31 +0200
changeset 26 700a68421116
parent 16 b4e251400e36
permissions -rw-r--r--
Adding .hgignore and the ia5test.
viric@16
     1
#include <stdio.h>
viric@16
     2
#include "dictre.h"
viric@16
     3
viric@16
     4
int main()
viric@16
     5
{
viric@16
     6
    char in[MAXWORD];
viric@16
     7
    enum Case vcase[MAXWORD];
viric@16
     8
    char tmp[MAXWORD];
viric@16
     9
    char recased[MAXWORD];
viric@16
    10
    int len;
viric@16
    11
    int i;
viric@16
    12
viric@16
    13
    printf("Insert string: ");
viric@16
    14
    fgets(in, MAXWORD, stdin);
viric@16
    15
    in[strlen(in)-1] = 0; /* Remove last '\n' */
viric@16
    16
    len = get_case(vcase, in);
viric@16
    17
    printf("Case: ");
viric@16
    18
    for(i=0; i < len; ++i)
viric@16
    19
    {
viric@16
    20
        printf("%i ", (int) vcase[i]);
viric@16
    21
    }
viric@16
    22
    putchar('\n');
viric@16
    23
viric@16
    24
    printf("Lower case: ");
viric@16
    25
    get_lowcase_str(tmp, in);
viric@16
    26
    remove_jo(tmp);
viric@16
    27
    printf("%s\n", tmp);
viric@16
    28
viric@16
    29
    printf("Reconstructed case: ");
viric@16
    30
    reapply_case(recased, tmp, vcase);
viric@16
    31
    printf("%s\n", recased);
viric@16
    32
}