#修改
This commit is contained in:
parent
156e62fa23
commit
b652639aae
|
@ -163,11 +163,11 @@ def test_json(request):
|
|||
if len(x) > 1 and x != '\r\n':
|
||||
c[x] += 1
|
||||
for (k, v) in c.most_common(200): # 遍历输出高频词
|
||||
print('%s%s %s %d' % (' ' * (5 - len(k)), k, '*', v))
|
||||
o = dict()
|
||||
o['name'] = k
|
||||
o['value'] = v
|
||||
res.append(o)
|
||||
if all(map(lambda c:'\u4e00' <= c <= '\u9fa5',k)):
|
||||
o = dict()
|
||||
o['name'] = k
|
||||
o['value'] = v
|
||||
res.append(o)
|
||||
return HttpResponse(json.dumps({
|
||||
"res": res
|
||||
}))
|
||||
|
|
Loading…
Reference in New Issue