MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _direction_terms

Function _direction_terms

experiments/baselines/discourse_aware/runner.py:332–348  ·  view source on GitHub ↗
(direction: Any)

Source from the content-addressed store, hash-verified

330
331
332def _direction_terms(direction: Any) -> List[str]:
333 direction_text = str(direction or "").strip()
334 if not direction_text:
335 return []
336 terms = [direction_text, direction_text.replace("-", " ")]
337 if direction_lexicon is None:
338 return terms
339 try:
340 expanded = direction_lexicon.expand_direction_terms([direction_text])
341 except Exception:
342 return terms
343 for entry in expanded.values():
344 terms.extend(parse_string_list(entry.get("aliases")))
345 terms.extend(parse_string_list(entry.get("paper_terms")))
346 terms.append(str(entry.get("name") or ""))
347 terms.append(str(entry.get("name_cn") or ""))
348 return [term for term in terms if term.strip()]
349
350
351def dedupe_strings(values: Iterable[Any]) -> List[str]:

Callers 1

build_initial_profileFunction · 0.70

Calls 2

getMethod · 0.80
parse_string_listFunction · 0.70

Tested by

no test coverage detected