Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
amot
parabix-devel
Commits
473647b6
Commit
473647b6
authored
4 years ago
by
jd
Browse files
Options
Download
Email Patches
Plain Diff
Updated readme and testcases
parent
cb869b75
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
2 deletions
+41
-2
QA/pinyin_test/pinyin_test.xml
QA/pinyin_test/pinyin_test.xml
+3
-1
README-pinyingrep.md
README-pinyingrep.md
+38
-1
No files found.
QA/pinyin_test/pinyin_test.xml
View file @
473647b6
...
...
@@ -17,6 +17,8 @@
<datafile
id =
"T3_pinyin"
>
想要好成绩,
需要努力进步。
这个产品称它能帮助你聪明一点。
但是当我看到考试成绩觉得惨了。
</datafile>
<grepcase
regexp =
"zhong yao"
datafile =
"T1_pinyin"
greplines =
"2 3"
/>
...
...
@@ -39,4 +41,4 @@
<grepcase
regexp =
"yao4"
datafile =
"T3_pinyin"
greplines =
"2"
/>
<grepcase
regexp =
"bu4"
datafile =
"T3_pinyin"
greplines =
"3"
/>
</greptest>
\ No newline at end of file
</greptest>
This diff is collapsed.
Click to expand it.
README-pinyingrep.md
View file @
473647b6
...
...
@@ -163,11 +163,48 @@ Output:
Please enter the correct format of syllables, listed in the README-pinyingrep.md, for example 'ming'.
```
#### Testcase 3.2 -- *Display Grep Line Number for Matched Characters*
Input
`-n`
right before pinyin input, to display the grep line of matched characters
```
Command:
bin/pinyin_grep -n zhong ../QA/pinyin_test/testfiles/T1_pinyin
Input:
-n zhong
Output:
2:这列子可能是重要
3:喝中药一定要吃山楂饼
```
#### Testcase 3.3 -- *Display File Path for Matched Characters in Multi File Input*
Input
`-h`
right before pinyin input, to display the file path of matched characters
```
Command:
bin/pinyin_grep -h shui ../QA/pinyin_test/testfiles/T1_pinyin ../QA/pinyin_test/testfiles/T2_regex
Input:
-h shui
Output:
../QA/pinyin_test/testfiles/T1_pinyin:写完了去睡觉
../QA/pinyin_test/testfiles/T2_regex:睡眠不足,没有梦想。
```
#### Testcase 3.4 -- *Case Insensitive*
`SHANG`
,
`Shang`
,
`ShAnG`
, and
`shang`
would all have the same results
```
Command:
bin/pinyin_grep DING ../QA/pinyin_test/testfiles/T1_pinyin
Input:
DING
Output:
喝中药一定要吃山楂饼
```
#### Testcase 3.5 -- *Loose Matching*
Allows for a more general search for pinyin pairs such as
`zh`
and
`z`
Allows for a more general search for pinyin pairs such as
`zh`
and
`z`
, by using
`?`
```
Command:
bin/pinyin_grep -data ch?an ../QA/pinyin_test/testfiles/T3_pinyin
Input:
ch?an
Output:
这个产品称它能帮助你聪明一点。
但是当我看到考试成绩觉得惨了。
```
#### Testcase 3.6 -- *Regular Expression -- `[]`*
`[zc]hang`
seaches for
`zhang`
and
`chang`
```
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment