fixed anomalous backslash in string
This commit is contained in:
parent
dd164484a3
commit
9fb76efc35
@ -8,7 +8,7 @@
|
|||||||
import sys
|
import sys
|
||||||
import re
|
import re
|
||||||
|
|
||||||
WORD_RE = re.compile('\w+')
|
WORD_RE = re.compile(r'\w+')
|
||||||
|
|
||||||
index = {}
|
index = {}
|
||||||
with open(sys.argv[1], encoding='utf-8') as fp:
|
with open(sys.argv[1], encoding='utf-8') as fp:
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
import sys
|
import sys
|
||||||
import re
|
import re
|
||||||
|
|
||||||
WORD_RE = re.compile('\w+')
|
WORD_RE = re.compile(r'\w+')
|
||||||
|
|
||||||
index = {}
|
index = {}
|
||||||
with open(sys.argv[1], encoding='utf-8') as fp:
|
with open(sys.argv[1], encoding='utf-8') as fp:
|
||||||
|
@ -9,7 +9,7 @@ import sys
|
|||||||
import re
|
import re
|
||||||
import collections
|
import collections
|
||||||
|
|
||||||
WORD_RE = re.compile('\w+')
|
WORD_RE = re.compile(r'\w+')
|
||||||
|
|
||||||
index = collections.defaultdict(list) # <1>
|
index = collections.defaultdict(list) # <1>
|
||||||
with open(sys.argv[1], encoding='utf-8') as fp:
|
with open(sys.argv[1], encoding='utf-8') as fp:
|
||||||
|
@ -5,7 +5,7 @@ Sentence: access words by index
|
|||||||
import re
|
import re
|
||||||
import reprlib
|
import reprlib
|
||||||
|
|
||||||
RE_WORD = re.compile('\w+')
|
RE_WORD = re.compile(r'\w+')
|
||||||
|
|
||||||
|
|
||||||
class Sentence:
|
class Sentence:
|
||||||
|
@ -5,7 +5,7 @@ Sentence: iterate over words using a generator function
|
|||||||
import re
|
import re
|
||||||
import reprlib
|
import reprlib
|
||||||
|
|
||||||
RE_WORD = re.compile('\w+')
|
RE_WORD = re.compile(r'\w+')
|
||||||
|
|
||||||
|
|
||||||
class Sentence:
|
class Sentence:
|
||||||
|
@ -5,7 +5,7 @@ Sentence: iterate over words using a generator function
|
|||||||
import re
|
import re
|
||||||
import reprlib
|
import reprlib
|
||||||
|
|
||||||
RE_WORD = re.compile('\w+')
|
RE_WORD = re.compile(r'\w+')
|
||||||
|
|
||||||
|
|
||||||
class Sentence:
|
class Sentence:
|
||||||
|
@ -6,7 +6,7 @@ Sentence: iterate over words using a generator expression
|
|||||||
import re
|
import re
|
||||||
import reprlib
|
import reprlib
|
||||||
|
|
||||||
RE_WORD = re.compile('\w+')
|
RE_WORD = re.compile(r'\w+')
|
||||||
|
|
||||||
|
|
||||||
class Sentence:
|
class Sentence:
|
||||||
|
@ -9,7 +9,7 @@ see: sentence_gen*.py.
|
|||||||
import re
|
import re
|
||||||
import reprlib
|
import reprlib
|
||||||
|
|
||||||
RE_WORD = re.compile('\w+')
|
RE_WORD = re.compile(r'\w+')
|
||||||
|
|
||||||
|
|
||||||
class Sentence:
|
class Sentence:
|
||||||
|
@ -8,7 +8,7 @@ see: sentence_gen*.py.
|
|||||||
import re
|
import re
|
||||||
import reprlib
|
import reprlib
|
||||||
|
|
||||||
RE_WORD = re.compile('\w+')
|
RE_WORD = re.compile(r'\w+')
|
||||||
|
|
||||||
|
|
||||||
class Sentence:
|
class Sentence:
|
||||||
|
@ -64,9 +64,9 @@ import itertools
|
|||||||
import functools
|
import functools
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
RE_WORD = re.compile('\w+')
|
RE_WORD = re.compile(r'\w+')
|
||||||
RE_UNICODE_NAME = re.compile('^[A-Z0-9 -]+$')
|
RE_UNICODE_NAME = re.compile('^[A-Z0-9 -]+$')
|
||||||
RE_CODEPOINT = re.compile('U\+([0-9A-F]{4,6})')
|
RE_CODEPOINT = re.compile(r'U\+([0-9A-F]{4,6})')
|
||||||
|
|
||||||
INDEX_NAME = 'charfinder_index.pickle'
|
INDEX_NAME = 'charfinder_index.pickle'
|
||||||
MINIMUM_SAVE_LEN = 10000
|
MINIMUM_SAVE_LEN = 10000
|
||||||
|
@ -64,7 +64,7 @@ import itertools
|
|||||||
import functools
|
import functools
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
RE_WORD = re.compile('\w+')
|
RE_WORD = re.compile(r'\w+')
|
||||||
RE_UNICODE_NAME = re.compile('^[A-Z0-9 -]+$')
|
RE_UNICODE_NAME = re.compile('^[A-Z0-9 -]+$')
|
||||||
RE_CODEPOINT = re.compile('U\+([0-9A-F]{4,6})')
|
RE_CODEPOINT = re.compile('U\+([0-9A-F]{4,6})')
|
||||||
|
|
||||||
|
@ -63,9 +63,9 @@ import warnings
|
|||||||
import itertools
|
import itertools
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
RE_WORD = re.compile('\w+')
|
RE_WORD = re.compile(r'\w+')
|
||||||
RE_UNICODE_NAME = re.compile('^[A-Z0-9 -]+$')
|
RE_UNICODE_NAME = re.compile('^[A-Z0-9 -]+$')
|
||||||
RE_CODEPOINT = re.compile('U\+([0-9A-F]{4,6})')
|
RE_CODEPOINT = re.compile(r'U\+([0-9A-F]{4,6})')
|
||||||
|
|
||||||
INDEX_NAME = 'charfinder_index.pickle'
|
INDEX_NAME = 'charfinder_index.pickle'
|
||||||
MINIMUM_SAVE_LEN = 10000
|
MINIMUM_SAVE_LEN = 10000
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
import sys
|
import sys
|
||||||
import re
|
import re
|
||||||
|
|
||||||
NONWORD_RE = re.compile('\W+')
|
NONWORD_RE = re.compile(r'\W+')
|
||||||
|
|
||||||
idx = {}
|
idx = {}
|
||||||
with open(sys.argv[1], encoding='utf-8') as fp:
|
with open(sys.argv[1], encoding='utf-8') as fp:
|
||||||
|
@ -6,9 +6,9 @@ import re
|
|||||||
import reprlib
|
import reprlib
|
||||||
|
|
||||||
|
|
||||||
RE_TOKEN = re.compile('\w+|\s+|[^\w\s]+')
|
RE_TOKEN = re.compile(r'\w+|\s+|[^\w\s]+')
|
||||||
RE_WORD = re.compile('\w+')
|
RE_WORD = re.compile('\w+')
|
||||||
RE_PUNCTUATION = re.compile('[^\w\s]+')
|
RE_PUNCTUATION = re.compile(r'[^\w\s]+')
|
||||||
|
|
||||||
|
|
||||||
class SentenceSlice:
|
class SentenceSlice:
|
||||||
|
Loading…
Reference in New Issue
Block a user