Skip to content

Commit

Permalink
prepare v3.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
ifplusor committed May 30, 2020
1 parent 2f5b30d commit 5357a8c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 5 deletions.
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,37 @@ pip install dist/actrie-*.whl

## Python example

### vocab.txt

```text
pattern0
pattern1
pattern2
...
```

### example.py

```python
#!/usr/bin/env python
# coding=utf-8

from actrie import *

pattern = "f|(a|b).{0,5}(e(?&!ef)|g)"
pattern = r"f|(a|b).{0,5}(e(?&!ef)|g)
abc
efg"

content = "abcdefg"


def test():
global pattern, content

# create matcher
# create matcher by file
#matcher = Matcher.create_by_file("vocab.txt")

# create matcher by string
matcher = Matcher.create_by_string(pattern)

# iterator
Expand Down
21 changes: 19 additions & 2 deletions README.zh_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,20 +122,37 @@ pip install dist/actrie-*.whl

## Python使用样例

### vocab.txt

```text
pattern0
pattern1
pattern2
...
```

### example.py

```python
#!/usr/bin/env python
# coding=utf-8

from actrie import *

pattern = "f|(a|b).{0,5}(e(?&!ef)|g)"
pattern = r"f|(a|b).{0,5}(e(?&!ef)|g)
abc
efg"

content = "abcdefg"


def test():
global pattern, content

# 创建匹配器
# 从文件创建匹配器
#matcher = Matcher.create_by_file("vocab.txt")

# 从字符串创建匹配器
matcher = Matcher.create_by_string(pattern)

# 通过迭代器获取匹配结果
Expand Down
2 changes: 1 addition & 1 deletion actrie/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@

__all__ = ['Matcher', 'Context', 'PrefixMatcher']

__version__ = '3.0.7'
__version__ = '3.0.8'

0 comments on commit 5357a8c

Please sign in to comment.