mirror of
https://github.com/yanyiwu/cppjieba.git
synced 2025-07-18 00:00:12 +08:00
rm scripts/*
This commit is contained in:
parent
a44b04df20
commit
308e247476
@ -1 +0,0 @@
|
||||
sed -i '1i/************************************\n * file enc : utf8\n * author : wuyanyi09@gmail.com\n************************************/' ../src/*.h ../src/*.cpp ../src/*.tcc
|
@ -1,29 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import sys
|
||||
|
||||
if len(sys.argv) == 1:
|
||||
print "usage : %s dict_file1 dict_file2 ..."
|
||||
exit(1)
|
||||
|
||||
d = {}
|
||||
|
||||
for fname in sys.argv[1:]:
|
||||
with open(fname, "r") as fin:
|
||||
for i, line in enumerate(fin):
|
||||
try:
|
||||
word, cnt, tag = line.strip().split(" ")
|
||||
if word in d:
|
||||
print "error file[%s] line[%s] : %s" %(fname, i, line)
|
||||
exit(1)
|
||||
else:
|
||||
d[word] = True
|
||||
|
||||
if 0 >= int(cnt) :
|
||||
print "error file[%s] line[%s] : %s" %(fname, i, line)
|
||||
exit(1)
|
||||
except Exception as err:
|
||||
print "error file[%s] line[%s] : %s" %(fname, i, line)
|
||||
exit(1)
|
||||
|
||||
print "OK"
|
@ -1,23 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import sys
|
||||
|
||||
if len(sys.argv) == 1:
|
||||
print "usage : %s dict_file_path"
|
||||
exit(1)
|
||||
|
||||
d = {}
|
||||
with open(sys.argv[1], "r") as fin:
|
||||
for i, line in enumerate(fin):
|
||||
word, cnt, tag = line.strip().split(" ")
|
||||
if word in d:
|
||||
#print "error file[%s] line[%s] : %s" %(fname, i, line)
|
||||
#exit(1)
|
||||
continue
|
||||
else:
|
||||
d[word] = True
|
||||
if 0 >= int(cnt) :
|
||||
continue
|
||||
|
||||
print line.strip()
|
||||
|
@ -1,15 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import sys
|
||||
|
||||
if len(sys.argv) != 4:
|
||||
print "usage : %s from_enc to_enc dict_file_path \nexample: %s gbk utf-8 fname" %(__file__, __file__)
|
||||
exit(1)
|
||||
|
||||
with open(sys.argv[3], "r") as fin:
|
||||
for i, line in enumerate(fin):
|
||||
try:
|
||||
print line.strip().decode(sys.argv[1]).encode(sys.argv[2])
|
||||
except Exception as err:
|
||||
print >> sys.stderr, err
|
||||
|
Loading…
x
Reference in New Issue
Block a user