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

Function _direction_terms

experiments/baselines/nl_profile/runner.py:251–267  ·  view source on GitHub ↗
(direction: Any)

Source from the content-addressed store, hash-verified

249
250
251def _direction_terms(direction: Any) -> List[str]:
252 direction_text = str(direction or "").strip()
253 if not direction_text:
254 return []
255 terms = [direction_text, direction_text.replace("-", " ")]
256 if direction_lexicon is None:
257 return terms
258 try:
259 expanded = direction_lexicon.expand_direction_terms([direction_text])
260 except Exception:
261 return terms
262 for entry in expanded.values():
263 terms.extend(parse_string_list(entry.get("aliases")))
264 terms.extend(parse_string_list(entry.get("paper_terms")))
265 terms.append(str(entry.get("name") or ""))
266 terms.append(str(entry.get("name_cn") or ""))
267 return [term for term in terms if term.strip()]
268
269
270def build_natural_language_profile(user_meta: Dict[str, Any], role: Dict[str, Any]) -> Dict[str, Any]:

Callers 2

aspect_coverage_scoreFunction · 0.70

Calls 2

getMethod · 0.80
parse_string_listFunction · 0.70

Tested by

no test coverage detected