From b6ffbd6f79524f0bce116eadc789d0bf06f40716 Mon Sep 17 00:00:00 2001 From: Rangaraj Tirumala Date: Sat, 8 Jun 2019 16:01:55 -0400 Subject: [PATCH] began implementing clause type tagging --- tagger.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tagger.py b/tagger.py index 09fb470..98a96cf 100644 --- a/tagger.py +++ b/tagger.py @@ -86,14 +86,22 @@ def tagObj(obj): v_2_after = "" v_3_after = "" + modals = ['can', 'could', 'may', 'might', 'shall', 'should', 'will', 'would', 'must'] + obj['clauseType'] = "Ambiguous" + # Tag Clause Type: - if obj['questType'] == "Relative Clause": - obj['clauseType'] = "Ambiguous" + if obj['questType'] == "Root Question": + if v_1_after in modals: + obj['clauseType'] = "Modal" + else: + obj['clauseType'] = "Finite" + elif obj['questType'] == "Embeded Question": - obj['clauseType'] = "Ambiguous" - else: - obj['clauseType'] = "Ambiguous" - + if v_1_after in modals: + obj['clauseType'] = "Modal" + else: + obj['clauseType'] = "Finite" + return obj def tagList(json:list):