Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
jiesutd committed Apr 20, 2022
1 parent 45bd7f5 commit 8419caf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This GUI annotation tool is developed with tkinter package in Python.

System required: Python 2.7

Author: [Jie Yang](https://jiesutd.github.io), Phd Candidate of SUTD.
Author: [Jie Yang](https://jiesutd.github.io), Assistant Professor at Zhejiang University, China.

Interface:
====
Expand Down Expand Up @@ -71,7 +71,7 @@ Important features:

Cite:
========
If you use YEDDA for research, please cite our [ACL paper](https://arxiv.org/pdf/1711.03759.pdf) as follows:
If you use YEDDA for research, please cite our [ACL paper](https://aclanthology.org/P18-4006.pdf) as follows:

@article{yang2017yedda,
title={YEDDA: A Lightweight Collaborative Text Span Annotation Tool},
Expand All @@ -88,7 +88,7 @@ Updating...
* 2018-Oct-20, YEDDA has a slight update in which shortcut maps can be edited, stored and switched seamlessly.
* 2018-May-07, Repository is renamed as YEDDA now!
* 2018-May-01, Our paper has been accepted as a demonstration at ACL 2018.
* 2017-Sep-27, (YEDDA V 1.0): project was officially named as YEDDA ! See our paper [here](https://arxiv.org/pdf/1711.03759.pdf).
* 2017-Sep-27, (YEDDA V 1.0): project was officially named as YEDDA ! See our paper [here](https://aclanthology.org/P18-4006.pdf).
* 2017-June-24, (V 0.6): support nested coloring; add event annotation beta version [Event_beta.py](Event_beta.py)
* 2017-May-31, (V 0.6): optimize for Windows OS.
* 2017-Apr-26, (V 0.5.3): fix bug with line merge when change entity type.
Expand Down
14 changes: 2 additions & 12 deletions YEDDA.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,12 @@ def initUI(self):
# # b.grid(row =1 , column = 3)
# b.pack(side='left')


lbl_entry = Label(self, text="Command:")
lbl_entry.grid(row = self.textRow +1, sticky = E+W+S+N, pady=4,padx=4)
self.entry = Entry(self)
self.entry.grid(row = self.textRow +1, columnspan=self.textColumn + 1, rowspan = 1, sticky = E+W+S+N, pady=4, padx=80)
self.entry.bind('<Return>', self.returnEnter)




# for press_key in self.pressCommand.keys():
for idx in range(0, len(self.allKey)):
press_key = self.allKey[idx]
Expand Down Expand Up @@ -486,7 +482,6 @@ def deleteTextInput(self,event):
self.writeFile(self.fileName, content, last_insert)



def replaceString(self, content, string, replaceType, cursor_index):
if replaceType in self.pressCommand:
new_string = "[@" + string + "#" + self.pressCommand[replaceType] + "*]"
Expand Down Expand Up @@ -520,6 +515,7 @@ def writeFile(self, fileName, content, newcursor_index):
else:
print("Don't write to empty file!")


def addRecommendContent(self, train_data, decode_data, recommendMode):
if not recommendMode:
content = train_data + decode_data
Expand All @@ -529,6 +525,7 @@ def addRecommendContent(self, train_data, decode_data, recommendMode):
content = maximum_matching(train_data, decode_data)
return content


def autoLoadNewFile(self, fileName, newcursor_index):
if self.debug:
print("Action Track: autoLoadNewFile")
Expand Down Expand Up @@ -598,7 +595,6 @@ def setColorDisplay(self):
lastsecond_pos = "%s+%sc" % (recommend_pos, str(int(countVar.get())))
self.text.tag_add("recommend", first_pos, lastsecond_pos)


## color the most inside span for nested span, scan from begin to end again
if self.colorAllChunk:
self.text.mark_set("matchStart", "1.0")
Expand Down Expand Up @@ -754,7 +750,6 @@ def on_select(self, event=None):
def getCursorIndex(self):
return self.text.index(INSERT)


def generateSequenceFile(self):
if (".ann" not in self.fileName) and (".txt" not in self.fileName):
out_error = "Export only works on filename ended in .ann or .txt!\nPlease rename file."
Expand Down Expand Up @@ -916,10 +911,6 @@ def removeRecommendContent(content, recommendRe = r'\[\$.*?\#.*?\*\](?!\#)'):
return output_content






def decompositCommand(command_string):
command_list = []
each_command = []
Expand All @@ -937,7 +928,6 @@ def decompositCommand(command_string):
return command_list



def main():
print("SUTDAnnotator launched!")
print(("OS:%s")%(platform.system()))
Expand Down

0 comments on commit 8419caf

Please sign in to comment.