Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
凌建发 committed Feb 8, 2021
1 parent 14502d3 commit 81ce680
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 8 deletions.
3 changes: 2 additions & 1 deletion get/append.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
recognize
recognize 2000
church 5000
11 changes: 9 additions & 2 deletions get/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,12 @@ def mix_sort(elem):
res = min(elem["freq_index"], res)
if "bnc_index" in elem:
res = min(elem["bnc_index"], res)
return res

def fin_sort(elem):
res = elem["seq"]
if "adjust_index" in elem:
res = min(elem["adjust_index"], res)
res = elem["adjust_index"]
return res

def sequence(wordmap):
Expand All @@ -206,7 +210,10 @@ def sequence(wordmap):
wordsort1.append(wordmap[word])
wordsort1.sort(key=mix_sort, reverse=False)
for i, word in enumerate(wordsort1):
wordmap[word["word"]]["seq"] = i + 1
word["seq"] = i + 1
wordsort1.sort(key=fin_sort, reverse=False)
for i, word in enumerate(wordsort1):
word["seq"] = i + 1
return wordsort1

def build_family(wordmap):
Expand Down
9 changes: 8 additions & 1 deletion get/ignore.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ km
ft
ad
re
en
lb
ma
yon
Expand Down Expand Up @@ -130,4 +131,10 @@ its
albeit
cannot
working
hast
hast
putt
clearly
entirely
notwithstanding
papa
doth
2 changes: 1 addition & 1 deletion get/wordmap.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ function show_words(words, a1, a2) {
} else {
res[x.w] = [
x.i,
x.p[0],
short_explain(x.e),
];
}
Expand Down Expand Up @@ -182,7 +183,7 @@ if (!args[0]) {
r2 = {};
wordlist.forEach(function (x, i) {
if (start <= i && i < end) {
r2[x.w] = [x.i, short_explain(x.e)];
r2[x.w] = [x.i, x.p[0], short_explain(x.e)];
}
});

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "h2dict",
"version": "1.5.0",
"version": "1.6.0",
"repository": "http://registry.npmjs.org/h2dict",
"main": "index.js",
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion wordlist.json

Large diffs are not rendered by default.

0 comments on commit 81ce680

Please sign in to comment.