From dd31367bdfdc250a628a71592e05846302766ddd Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Mon, 1 Apr 2013 17:49:41 +0800 Subject: polish code --- tests/storage/test_parser2.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/storage/test_parser2.cpp b/tests/storage/test_parser2.cpp index cc330e9..638cd96 100644 --- a/tests/storage/test_parser2.cpp +++ b/tests/storage/test_parser2.cpp @@ -52,13 +52,6 @@ using namespace pinyin; int main(int argc, char * argv[]) { - PinyinParser2 * parser = NULL; - ChewingKeyVector keys = g_array_new(FALSE, FALSE, sizeof(ChewingKey)); - ChewingKeyRestVector key_rests = - g_array_new(FALSE, FALSE, sizeof(ChewingKeyRest)); - - pinyin_option_t options = PINYIN_CORRECT_ALL | USE_TONE | USE_RESPLIT_TABLE; - GError * error = NULL; GOptionContext * context; @@ -69,9 +62,15 @@ int main(int argc, char * argv[]) { exit(EINVAL); } + pinyin_option_t options = PINYIN_CORRECT_ALL | USE_TONE | USE_RESPLIT_TABLE; if (incomplete) options |= PINYIN_INCOMPLETE | CHEWING_INCOMPLETE; + PinyinParser2 * parser = NULL; + ChewingKeyVector keys = g_array_new(FALSE, FALSE, sizeof(ChewingKey)); + ChewingKeyRestVector key_rests = + g_array_new(FALSE, FALSE, sizeof(ChewingKeyRest)); + /* create the parser */ if (strcmp("fullpinyin", parsername) == 0) { parser = new FullPinyinParser2(); -- cgit