]> thyrsus.com Git - letterize.git/commitdiff
This version seems to work OK.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 25 Oct 1994 00:02:50 +0000 (00:02 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 25 Oct 1994 00:02:50 +0000 (00:02 +0000)
letterize.c

index 89d1bd216644dc5afc229810278ad597daad7d83..47e7f89ff49e4832233117ccaa2beed212b1a5d1 100644 (file)
@@ -185,6 +185,7 @@ char word[];                        /* word to do, max 20 chars */
     register char ch;          /* working char */
     short pat[21];             /* pattern of mapped values */
 
+    unusual = 0;
     for (i=0; word[i] && (i < sizeof(pat)); i++)       /* scan until null */
     {  
        patcnt = i;             /* max value */
@@ -195,15 +196,7 @@ char word[];                       /* word to do, max 20 chars */
     }
     for (i=0; i < patcnt - 1; i++)     /* for all triples */
        dotriple(pat[i], pat[i+1], pat[i+2]); /* do the triple */
-}
-
-int reasonable(s)
-/* check for 'reasonableness' of a string */
-char *s;
-{
-    unusual = 0;                       /* no unusual triples yet */
-    obvword(s);                                /* try the word */
-    return(unusual != 0);
+    return(unusual == 0);
 }
 
 void phone_gen(s, i)
@@ -220,7 +213,7 @@ int i;
 
     if (c == '\0')
     {
-       if (reasonable(s))
+       if (obvword(s))
            (void) printf("%s\n", s);
     }
     else if ('2' <= c && c <= '9')