MCPcopy Create free account
hub / github.com/DataArcTech/ToG / check_end_word

Function check_end_word

ToG/freebase_func.py:13–15  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

11sparql_id = """PREFIX ns: <http://rdf.freebase.com/ns/>\nSELECT DISTINCT ?tailEntity\nWHERE {\n {\n ?entity ns:type.object.name ?tailEntity .\n FILTER(?entity = ns:%s)\n }\n UNION\n {\n ?entity <http://www.w3.org/2002/07/owl#sameAs> ?tailEntity .\n FILTER(?entity = ns:%s)\n }\n}"""
12
13def check_end_word(s):
14 words = [" ID", " code", " number", "instance of", "website", "URL", "inception", "image", " rate", " count"]
15 return any(s.endswith(word) for word in words)
16
17def abandon_rels(relation):
18 if relation == "type.object.type" or relation == "type.object.name" or relation.startswith("common.") or relation.startswith("freebase.") or "sameAs" in relation:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected