From: Eric S. Raymond Date: Tue, 25 Oct 1994 00:02:50 +0000 (+0000) Subject: This version seems to work OK. X-Git-Tag: 1.0~1 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=0abd9fe5ae8e5999dc2dc00ed20c16b0714bd6c3;p=letterize.git This version seems to work OK. --- diff --git a/letterize.c b/letterize.c index 89d1bd2..47e7f89 100644 --- a/letterize.c +++ b/letterize.c @@ -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')