Skip to content

Commit

Permalink
Connection as resolver state
Browse files Browse the repository at this point in the history
  • Loading branch information
jbothma committed Jan 10, 2025
1 parent 2ad1d9f commit 685e3fc
Show file tree
Hide file tree
Showing 6 changed files with 259 additions and 280 deletions.
4 changes: 2 additions & 2 deletions nomenklatura/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def xref_file(
if clear and index_dir.exists():
log.info("Clearing index: %s", index_dir)
shutil.rmtree(index_dir, ignore_errors=True)

resolver_.begin()
run_xref(
resolver_,
store,
Expand All @@ -103,7 +103,7 @@ def xref_file(
scored=scored,
limit=limit,
)
resolver_.save()
resolver_.commit()
log.info("Xref complete in: %s", resolver_.path)


Expand Down
8 changes: 4 additions & 4 deletions nomenklatura/conflicting_match.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
from nomenklatura.entity import CE
from nomenklatura.store import View
from nomenklatura.judgement import Judgement
from nomenklatura.resolver import Resolver
from nomenklatura.resolver import Linker
from nomenklatura.statement.statement import Statement


class ConflictingMatchReporter(Generic[CE]):
def __init__(self, view: View[DS, CE], resolver: Resolver[CE], threshold: float):
def __init__(self, view: View[DS, CE], linker: Linker[CE], threshold: float):
self.console = Console()
self.view = view
self.resolver = resolver
self.linker = linker
self.threshold = threshold
self.matches: Dict[str, Set[str]] = defaultdict(set)

Expand All @@ -29,7 +29,7 @@ def check_match(self, score: float, left_id: str, right_id: str) -> None:
def get_conflicting_matches(self) -> Generator[Tuple[str, str, str], None, None]:
for candidate_id, matches in self.matches.items():
for left_id, right_id in combinations(matches, 2):
judgement = self.resolver.get_judgement(left_id, right_id)
judgement = self.linker.get_judgement(left_id, right_id)
if judgement == Judgement.NEGATIVE:
yield candidate_id, left_id, right_id

Expand Down
Loading

0 comments on commit 685e3fc

Please sign in to comment.