Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #1157 by renaming filelock to filelock_brat #1204

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions server/src/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# vim:set ft=python ts=4 sw=4 sts=4 autoindent:

from __future__ import with_statement

'''
Functionality related to the annotation file format.

Expand All @@ -25,7 +24,7 @@
from re import compile as re_compile

from common import ProtocolError
from filelock import file_lock
from filelock_brat import file_lock
from message import Messager


Expand Down
2 changes: 1 addition & 1 deletion server/src/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from os import listdir, walk
from subprocess import Popen, PIPE

from filelock import file_lock, PID_WARN
from filelock_brat import file_lock, PID_WARN

from config import BACKUP_DIR, DATA_DIR

Expand Down
File renamed without changes.
10 changes: 6 additions & 4 deletions tools/anntoconll.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
from collections import namedtuple
from os import path
from subprocess import Popen, PIPE
from cStringIO import StringIO
#from cStringIO import StringIO
from StringIO import StringIO
from codecs import open

# assume script in brat tools/ directory, extend path to find sentencesplit.py
sys.path.append(os.path.join(os.path.dirname(__file__), '../server/src'))
Expand Down Expand Up @@ -203,7 +205,7 @@ def process_files(files):
if fn == '-':
lines = process(sys.stdin)
else:
with open(fn, 'rU') as f:
with open(fn, 'rU', "utf8") as f:
lines = process(f)

# TODO: better error handling
Expand All @@ -214,7 +216,7 @@ def process_files(files):
sys.stdout.write(''.join(lines))
else:
ofn = path.splitext(fn)[0]+options.outsuffix
with open(ofn, 'wt') as of:
with open(ofn, 'wt', "utf8") as of:
of.write(''.join(lines))

except:
Expand Down Expand Up @@ -278,7 +280,7 @@ def get_annotations(fn):

annfn = path.splitext(fn)[0]+options.annsuffix

with open(annfn, 'rU') as f:
with open(annfn, 'rU', "utf8") as f:
textbounds = parse_textbounds(f)

textbounds = eliminate_overlaps(textbounds)
Expand Down
2 changes: 1 addition & 1 deletion tools/conll02tostandoff.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def process(fn):
token, tag = m.groups()

# parse tag
m = re.match(r'^([BIO])((?:-[A-Za-z_]+)?)$', tag)
m = re.match(r'^([BIO])((?:-[A-Za-z_\-]+)?)$', tag)
assert m, "ERROR: failed to parse tag '%s' in %s" % (tag, fn)
ttag, ttype = m.groups()
if len(ttype) > 0 and ttype[0] == "-":
Expand Down