Skip to content

Commit

Permalink
fix #24 and #29 by basically ignoring XPOS
Browse files Browse the repository at this point in the history
  • Loading branch information
harisont committed Apr 13, 2023
1 parent eab72a9 commit 25178cf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Errors.hs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ error2morphosynPattern e = (morphosynUDPattern p1,morphosynUDPattern p2)
-- | Shorthand to convert errors to universal morphosyntactic error patterns
error2uniMorphosynPattern :: Error -> ErrorPattern
error2uniMorphosynPattern e =
(uniMorphosynUDPattern p1,uniMorphosynUDPattern p2)
(uMorphosynUDPattern p1,uMorphosynUDPattern p2)
where (p1,p2) = error2Pattern e

-- | Show an error pattern as a single "L1-L2" pattern ({A -> B} syntax)
Expand Down
2 changes: 1 addition & 1 deletion src/Extract.hs
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ correct (s1,s2) = prUDTreeString s1 == prUDTreeString s2
-- NOTE on implementation: the hacky way I implemented this is to compare the
-- corresponding simplified (cf. simplifyUDPattern) UD patterns in HST
morphosynCorrect :: Alignment -> Bool
morphosynCorrect (s1,s2) = morphosynUDPattern t1 == morphosynUDPattern t2
morphosynCorrect (s1,s2) = uMorphosynUDPattern t1 == uMorphosynUDPattern t2
where (t1,t2) = (udTree2udPattern s1,udTree2udPattern s2)
4 changes: 2 additions & 2 deletions src/Utils/UDPatterns.hs
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ morphosynUDPattern = simplifyUDPattern morphosynFields

-- | Shorthand for getting the "universal" morphosyntactic (POS + FEATS +
-- DEPREL) UD pattern corresponding to a "full" UD pattern
uniMorphosynUDPattern :: UDPattern -> UDPattern
uniMorphosynUDPattern = simplifyUDPattern (morphosynFields \\ ["XPOS"])
uMorphosynUDPattern :: UDPattern -> UDPattern
uMorphosynUDPattern = simplifyUDPattern (morphosynFields \\ ["XPOS"])

-- | Remove the parts of a tree not described by a certain UDPattern
pruneUDTree :: UDPattern -> UDTree -> UDTree
Expand Down

0 comments on commit 25178cf

Please sign in to comment.