From 697a1adce1e463079e640b55d6386cf82d7bd6bc Mon Sep 17 00:00:00 2001 From: Malik Talha Date: Sun, 22 Oct 2023 21:06:23 +0500 Subject: Add Snips Inference Module Add slightly modified version of the original Snips NLU library. This module adds support for Python upto version 3.10. Bug-AGL: SPEC-4856 Signed-off-by: Malik Talha Change-Id: I6d7e9eb181e6ff4aed9b6291027877ccb9f0d846 --- .../entity_parser/custom_entity_parser_usage.py | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 snips_inference_agl/entity_parser/custom_entity_parser_usage.py (limited to 'snips_inference_agl/entity_parser/custom_entity_parser_usage.py') diff --git a/snips_inference_agl/entity_parser/custom_entity_parser_usage.py b/snips_inference_agl/entity_parser/custom_entity_parser_usage.py new file mode 100644 index 0000000..72d420a --- /dev/null +++ b/snips_inference_agl/entity_parser/custom_entity_parser_usage.py @@ -0,0 +1,23 @@ +from __future__ import unicode_literals + +from enum import Enum, unique + + +@unique +class CustomEntityParserUsage(Enum): + WITH_STEMS = 0 + """The parser is used with stemming""" + WITHOUT_STEMS = 1 + """The parser is used without stemming""" + WITH_AND_WITHOUT_STEMS = 2 + """The parser is used both with and without stemming""" + + @classmethod + def merge_usages(cls, lhs_usage, rhs_usage): + if lhs_usage is None: + return rhs_usage + if rhs_usage is None: + return lhs_usage + if lhs_usage == rhs_usage: + return lhs_usage + return cls.WITH_AND_WITHOUT_STEMS -- cgit 1.2.3-korg