MCPcopy Create free account
hub / github.com/aitjcize/cppman / _sort_crawl

Function _sort_crawl

cppman/main.py:44–65  ·  view source on GitHub ↗

Sorting entries for putting '(1)' indexes behind keyword 1. keywords that have 'std::' in them have highest priority 2. priority if 'std::' is inside their name 3. sorting by keyword 4. sorting by name

(entry)

Source from the content-addressed store, hash-verified

42
43
44def _sort_crawl(entry):
45 """ Sorting entries for putting '(1)' indexes behind keyword
46
47 1. keywords that have 'std::' in them have highest priority
48 2. priority if 'std::' is inside their name
49 3. sorting by keyword
50 4. sorting by name
51 """
52 id, title, keyword, count = entry
53 hasStd1 = keyword.find("std::")
54 if hasStd1 == -1:
55 hasStd1 = 1
56 else:
57 hasStd1 = 0
58
59 hasStd2 = title.find("std::")
60 if hasStd2 == -1:
61 hasStd2 = 1
62 else:
63 hasStd2 = 0
64
65 return (hasStd1, hasStd2, keyword, title)
66
67
68def _sort_search(entry, pattern):

Callers

nothing calls this directly

Calls 1

findMethod · 0.80

Tested by

no test coverage detected