Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Comments added.

  • Loading branch information...
commit bdd4ceb4a1fe8b99027cb1c62b06d43be5369c2b 1 parent a5da746
@julosaure authored
Showing with 5 additions and 10 deletions.
  1. +5 −10 editDistance.py
View
15 editDistance.py
@@ -4,7 +4,8 @@
from alignment import *
class SimpleEditDistance:
-
+ """ Standard Edit Distance.
+ """
def ins(self):
return 1
@@ -26,7 +27,9 @@ def match(self, item1, item2):
return score
class PosEditDistance:
-
+ """ POS enhanced edit distance: aligns preferentially tokens
+ that share a same POS.
+ """
def ins(self):
return 2
@@ -106,12 +109,4 @@ def match(self, item1, item2):
score = scoreTagMatch
break
- #elif tok1.tag == tok2.tag:
- #assert tok1.tag == tok2.tag, tok1.pp()+ " " +tok2.pp()
- # the POS match but not the tokens
- # score = 1
- #else:
- # substitution
- # score = 2
-
return score
Please sign in to comment.
Something went wrong with that request. Please try again.