diff options
| author | Peng Wu <alexepico@gmail.com> | 2010-09-09 14:15:08 +0800 |
|---|---|---|
| committer | Peng Wu <alexepico@gmail.com> | 2010-09-09 14:15:08 +0800 |
| commit | 9c20d17c0978f47ff2ae6e5f49f78a81db3040fa (patch) | |
| tree | 1d362e014244ef905c759df338cd79477e257599 /src/segment/spseg.cpp | |
| parent | 3662fa38302b6b75fe1b03dfb68edfa641e4f13c (diff) | |
| download | libpinyin-9c20d17c0978f47ff2ae6e5f49f78a81db3040fa.tar.gz libpinyin-9c20d17c0978f47ff2ae6e5f49f78a81db3040fa.tar.xz libpinyin-9c20d17c0978f47ff2ae6e5f49f78a81db3040fa.zip | |
WIP of spseg
Diffstat (limited to 'src/segment/spseg.cpp')
| -rw-r--r-- | src/segment/spseg.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/segment/spseg.cpp b/src/segment/spseg.cpp index a710d47..6522b2e 100644 --- a/src/segment/spseg.cpp +++ b/src/segment/spseg.cpp @@ -20,6 +20,7 @@ */ #include <stdio.h> +#include <string.h> #include <locale.h> #include <glib.h> #include "novel_types.h" @@ -85,5 +86,14 @@ int main(int argc, char * argv[]){ g_phrases->store(chunk); g_phrases->load(chunk); + char * linebuf = NULL; + size_t size = 0; + while(getline(&linebuf, &size, stdin)) { + if ( feof(stdin) ) + break; + linebuf[strlen(linebuf) - 1] = '\0'; + + + } return 0; } |
