Skip to content

Commit f05b2e2

Browse files
committed
LCA tie-breaking Now takes into consideration Visual proximity as well
1 parent 5716ee4 commit f05b2e2

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

CHANGELOG.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,33 @@
44

55
### Added
66

7-
* aenea support has been added by means of the server plug-ins, available in the bundles aenea folder.
7+
* aenea support has been added by means of the server plug-ins, available in the bundles aenea folder. this includes both the PythonVoiceCodingPluginAeneaServer.py and the corresponding yapsy-plugin file.
88

99
* in the tiebreak module function tiebreak_on_visual has been added, to enable more coherent tie-breaking
1010

1111
### Fixed
12+
1213
* fixed the empty brackets bug in the repair modulebugs with ":" addressed, needs more testing and a subsequent bug
1314

14-
* also in the repair module, we can now handle consecutive phase separated name tokens( and some mixing with error tokens) like the ones that can occur after a misrecognition, for instance "x = gibberish words " is now parsable!
15+
* also in the repair module, we can now handle consecutive space separated name tokens( and some mixing with error tokens) like the ones that can occur after a misrecognition, for instance "x = gibberish words " is now parsable!
1516

1617
* fixed one error in vertical direction + big_roi queries, which appeared when a region of interest spanned across multiple physical lines and was the selection origin of a query searching for a region of interest of the same kind and was causing an off by one error when going upwards.
1718

18-
* Fixed error in big_roi module , where when trying to select something in global scope with vertical direction big_roi_queries ,not checking for Nonetype object caused error
19+
* Fixed error in big_roi module , where when trying to select something in global scope with vertical direction big_roi_queries ,not checking definition_node for Nonetype object caused error
1920

2021
* Fixed error in the preliminary function of the big regions of interest, where if the cursor was at the last empty line of the function, selections would be given from the next function!
2122

2223
* Fixed old name of my output panel:)
2324

24-
* Fixed a bug in the argument module where not forwarding selections cause errors went down in lines for the above below keywords.
25+
* Fixed a bug in the argument module where not forwarding/backwarding selections could cause errors for the above below keywords.
2526

2627
* fixed a bug in the above/below argument command, which occasionally caused of by one errors.
2728

2829
### Changed
2930

30-
* The customer bundles have been modified to be usable with aenea !
31+
* The Caster bundles have been modified to be usable with aenea! both the 0.5 and 0.6 versions have been tested, with PythonVoiceCodingPlugin running on Ubuntu 16.04.
3132

32-
* collection queries no labels not to now have labels(names) and they display them
33+
* collection queries now have labels(names) and they display them on the output panel.
3334

3435
* a global state was added the application module, enabling insertion from the results of collection queries from other files
3536

@@ -45,7 +46,11 @@
4546

4647
* the abstract_vertical and big_roi modules have been modified so as to offer alternatives when there are multiple logical lines in the same physical line.
4748

48-
* argument,adjective_strategy,primitives have been mortified in order to standardize the behavior of the grammar when the target logical line response over multiple physical ones. furthermore, the issue with alternatives common from wrong direction and not close to the main result has been resolved
49+
* argument,adjective_strategy,primitives have been mortified in order to standardize the behavior of the grammar when the target logical line response over multiple physical ones.
50+
51+
* furthermore, the issue with alternatives common from wrong direction and not close to the main result has been resolved when used with above/ below keyword by means of tiebreak_on_visual function!
52+
53+
* additionally, even in case of ties when tie-breaking on the lowest common ancestor, the visual proximity is now taken into account!
4954

5055
## [0.0.3] - 2019-11-18
5156

queries/tiebreak.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def tiebreak_on_lca(root,origin,candidates):
2121
TYPE: Description
2222
"""
2323
lca = LCA(root)
24-
k = lambda x: (-1 * lca(x, origin,True),lca.get_depth(x))
24+
k = lambda x: (-1 * lca(x, origin,True),lca.get_depth(x),abs(x.first_token.start[0] - origin.first_token.start[0]))
2525
return sorted(candidates, key = k)
2626

2727

0 commit comments

Comments
 (0)