mirror of https://github.com/explosion/spaCy.git
* Add stubs for is_bracket/is_quote/is_left_punct/is_right_punct functions
This commit is contained in:
parent
ee975d36d0
commit
fe611132f0
|
@ -1,4 +1,5 @@
|
||||||
# -*- coding: utf8 -*-
|
# -*- coding: utf8 -*-
|
||||||
|
# cython: infer_types=True
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import unicodedata
|
import unicodedata
|
||||||
|
|
||||||
|
@ -48,6 +49,21 @@ cpdef bint is_ascii(unicode string):
|
||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
cpdef bint is_bracket(unicode string):
|
||||||
|
return False
|
||||||
|
|
||||||
|
cpdef bint is_quote(unicode string):
|
||||||
|
if string in ('"', "'"):
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
|
cpdef bint is_left_punct(unicode string):
|
||||||
|
return False
|
||||||
|
|
||||||
|
cpdef bint is_right_punct(unicode string):
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
cpdef bint is_title(unicode string):
|
cpdef bint is_title(unicode string):
|
||||||
return string.istitle()
|
return string.istitle()
|
||||||
|
|
Loading…
Reference in New Issue