Skip to content
Snippets Groups Projects
Commit 1b3e9805 authored by Alfen, T. van (Tanja)'s avatar Alfen, T. van (Tanja)
Browse files

Merge branch 'OS-quickfix-2'

parents e728ac1d d8ded4e1
No related branches found
No related tags found
1 merge request!51Os quickfix 2
......@@ -5,6 +5,7 @@ from anchor_algorithm import AnchorAlgorithm
from mistake_finder import MistakeFinder
from OpenDutchWordnet.wn_grid_parser import Wn_grid_parser
from semantic_checker import SemanticChecker
from utils import Utils as ut
class Statistics:
......@@ -18,8 +19,9 @@ class Statistics:
# currently the case, so the two operate seperately in this class.
# _parser and _seman_checker should be moved to MistakeFinder when
# possible.
self._parser = Wn_grid_parser(
"OpenDutchWordnet/resources/odwn/odwn_orbn_gwg-LMF_1.3.xml.gz")
self.path = "OpenDutchWordnet/resources/odwn/odwn_orbn_gwg-LMF_1.3.xml.gz"
self._parser = Wn_grid_parser(ut.get_path(self.path)
)
self._parser.load_synonyms_dicts()
self._seman_checker = SemanticChecker(self._parser)
self._mistake_finder = MistakeFinder(self._seman_checker)
......@@ -68,4 +70,3 @@ class Statistics:
self._mistake_finder.start(source_align_em, shadow_align_em)
return source_align_em, shadow_align_em, correctness
import sys
class Utils:
@staticmethod
......@@ -32,3 +33,9 @@ class Utils:
m, s = divmod(s, 60)
h, m = divmod(m, 60)
return "%02i:%02i:%02i.%03i" % (h, m, s, ms)
def get_path(path):
if sys.platform.startswith('freebsd'):
return path
elif sys.platform.startswith('linux'):
return"./umbra/"+path
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment