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

Function _direction_terms

experiments/baselines/knowledge_entity/runner.py:385–401  ·  view source on GitHub ↗
(direction: Any)

Source from the content-addressed store, hash-verified

383
384
385def _direction_terms(direction: Any) -> List[str]:
386 direction_text = str(direction or "").strip()
387 if not direction_text:
388 return []
389 terms = [direction_text, direction_text.replace("-", " ")]
390 if direction_lexicon is None:
391 return terms
392 try:
393 expanded = direction_lexicon.expand_direction_terms([direction_text])
394 except Exception:
395 return terms
396 for entry in expanded.values():
397 terms.extend(parse_string_list(entry.get("aliases")))
398 terms.extend(parse_string_list(entry.get("paper_terms")))
399 terms.append(str(entry.get("name") or ""))
400 terms.append(str(entry.get("name_cn") or ""))
401 return [term for term in terms if term.strip()]
402
403
404def build_initial_profile(user_meta: Dict[str, Any], role: Dict[str, Any]) -> Dict[str, Any]:

Callers 1

build_initial_profileFunction · 0.70

Calls 2

getMethod · 0.80
parse_string_listFunction · 0.70

Tested by

no test coverage detected