How to use the conllu.parser.parse_comment_line function in conllu

To help you get started, we’ve selected a few conllu examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github EmilStenstrom / conllu / tests / test_parser.py View on Github external
def test_parse_comment_line_optional_value_no_space(self):
        data = '#newdoc'
        self.assertEqual(parse_comment_line(data), [("newdoc", None)])
        data = '#newpar'
        self.assertEqual(parse_comment_line(data), [("newpar", None)])
        data = '#invalid'
        self.assertEqual(parse_comment_line(data), [])
github EmilStenstrom / conllu / tests / test_parser.py View on Github external
def test_parse_comment_line(self):
        data = "# sent_id = 1"
        self.assertEqual(parse_comment_line(data), [("sent_id", "1")])
github EmilStenstrom / conllu / tests / test_parser.py View on Github external
def test_parse_comment_line_multiple_equals(self):
        data = "# text = five plus three = eight"
        self.assertEqual(parse_comment_line(data), [("text", "five plus three = eight")])
github EmilStenstrom / conllu / tests / test_parser.py View on Github external
def test_parse_comment_line_without_space(self):
        data = "#sent_id = 1"
        self.assertEqual(parse_comment_line(data), [("sent_id", "1")])
github EmilStenstrom / conllu / tests / test_parser.py View on Github external
def test_parse_comment_line_optional_value(self):
        data = '# newdoc'
        self.assertEqual(parse_comment_line(data), [("newdoc", None)])
        data = '# newpar'
        self.assertEqual(parse_comment_line(data), [("newpar", None)])
        data = '# invalid'
        self.assertEqual(parse_comment_line(data), [])
github EmilStenstrom / conllu / tests / test_parser.py View on Github external
def test_parse_comment_line_optional_value(self):
        data = '# newdoc'
        self.assertEqual(parse_comment_line(data), [("newdoc", None)])
        data = '# newpar'
        self.assertEqual(parse_comment_line(data), [("newpar", None)])
        data = '# invalid'
        self.assertEqual(parse_comment_line(data), [])
github EmilStenstrom / conllu / tests / test_parser.py View on Github external
def test_parse_comment_line_optional_value_no_space(self):
        data = '#newdoc'
        self.assertEqual(parse_comment_line(data), [("newdoc", None)])
        data = '#newpar'
        self.assertEqual(parse_comment_line(data), [("newpar", None)])
        data = '#invalid'
        self.assertEqual(parse_comment_line(data), [])
github EmilStenstrom / conllu / tests / test_parser.py View on Github external
def test_parse_spaces_before_square(self):
        data = ["# a = 1", "  # a = 1", "\t# a = 1"]
        for item in data:
            self.assertEqual(parse_comment_line(item), [("a", "1")])
github EmilStenstrom / conllu / tests / test_parser.py View on Github external
def test_parse_comment_line_without_square(self):
        data = "sent_id = 1"
        with self.assertRaises(ParseException):
            parse_comment_line(data)
github EmilStenstrom / conllu / tests / test_parser.py View on Github external
def test_parse_comment_line_without_equals(self):
        data = "# sent_id: 1"
        self.assertEqual(parse_comment_line(data), [])