summaryrefslogtreecommitdiffstats
path: root/statgen/debug.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2005-06-16 23:19:27 +0000
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2005-06-16 23:19:27 +0000
commit70fbe7822024d0acc68df3607ff25bf8d7a71751 (patch)
tree553cd2ef8cfc936fc890113596db2c4478fe5163 /statgen/debug.c
downloadlibrcd-70fbe7822024d0acc68df3607ff25bf8d7a71751.tar.gz
librcd-70fbe7822024d0acc68df3607ff25bf8d7a71751.tar.bz2
librcd-70fbe7822024d0acc68df3607ff25bf8d7a71751.tar.xz
librcd-70fbe7822024d0acc68df3607ff25bf8d7a71751.zip
initial import
(automatically generated log message)
Diffstat (limited to 'statgen/debug.c')
-rw-r--r--statgen/debug.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/statgen/debug.c b/statgen/debug.c
new file mode 100644
index 0000000..85b950b
--- /dev/null
+++ b/statgen/debug.c
@@ -0,0 +1,33 @@
+#include <stdio.h>
+#define _AUTO_DEBUG
+#include "charset_auto_russian.h"
+
+
+main(int argc, char *argv[]) {
+ FILE *f;
+ int len,st;
+ char word[256];
+
+
+ if (argc!=2) {
+ printf("Usage: %s <file name>\n",argv[0]);
+ exit(0);
+ }
+
+ f=fopen(argv[1],"r");
+ if (!f) {
+ printf("Failed to open specified file. Check permissions!\n");
+ exit(1);
+ }
+
+ while(!feof(f)) {
+ fscanf(f,"%s",&word);
+// len=strlen(word)-1;
+ for(st=0;word[st]=='"'||word[st]=='\''||word[st]=='(';st++);
+ for(len=strlen(word)-1;word[len]==','||word[len]=='.'||word[len]=='!'||word[len]=='?'||word[len]==';'||word[len]=='-'||word[len]==':'||word[len]=='"'||word[len]=='\''||word[len]==')';len--);
+ if (len<5) continue;
+ else word[len+1]=0;
+
+ autocharset_russian_uc(word+st,len+1-st);
+ }
+}