From 0da98193e18fd405e494ad3f1cf565bcd92edf81 Mon Sep 17 00:00:00 2001 From: J08nY Date: Tue, 11 Apr 2023 17:49:25 +0200 Subject: Process cert name and entry name the same. --- src/sec_certs/model/cc_matching.py | 4 ++-- src/sec_certs/model/fips_matching.py | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/sec_certs/model/cc_matching.py b/src/sec_certs/model/cc_matching.py index d6a6d2cd..2acf4828 100644 --- a/src/sec_certs/model/cc_matching.py +++ b/src/sec_certs/model/cc_matching.py @@ -5,7 +5,7 @@ from typing import Mapping from rapidfuzz import fuzz from sec_certs.sample import CCCertificate, CertificateId -from sec_certs.utils.strings import fully_sanitize_string, lemmatize_product_name, load_spacy_model +from sec_certs.utils.strings import fully_sanitize_string class CCSchemeMatcher: @@ -24,7 +24,7 @@ class CCSchemeMatcher: self._canonical_cert_id = CertificateId(self.scheme, cert_id).canonical else: self._canonical_cert_id = None - self._product = lemmatize_product_name(load_spacy_model(), self.entry.get("product") or self.entry.get("title")) + self._product = fully_sanitize_string(self.entry.get("product") or self.entry.get("title")) self._vendor = fully_sanitize_string( self.entry.get("vendor") or self.entry.get("developer") diff --git a/src/sec_certs/model/fips_matching.py b/src/sec_certs/model/fips_matching.py index d6b92061..f73067b3 100644 --- a/src/sec_certs/model/fips_matching.py +++ b/src/sec_certs/model/fips_matching.py @@ -7,7 +7,7 @@ from typing import Mapping, MutableMapping from rapidfuzz import fuzz from sec_certs.configuration import config -from sec_certs.utils.strings import fully_sanitize_string, lemmatize_product_name, load_spacy_model +from sec_certs.utils.strings import fully_sanitize_string if typing.TYPE_CHECKING: from sec_certs.dataset.fips import FIPSDataset @@ -27,10 +27,9 @@ class FIPSProcessMatcher: self._prepare() def _prepare(self): - self._product = lemmatize_product_name(load_spacy_model(), self.entry.module_name) + self._product = fully_sanitize_string(self.entry.module_name) self._vendor = fully_sanitize_string(self.entry.vendor_name) self._standard = self.entry.standard - # self._date = getattr(self.entry, "status_since", None) or getattr(self.entry, "iut_date", None) def match(self, cert: FIPSCertificate) -> float: """ -- cgit v1.3.1