mirror of
https://github.com/fxsjy/jieba.git
synced 2025-07-10 00:01:33 +08:00
fix problems in auto2to3
This commit is contained in:
parent
7a6caa0c3c
commit
4a6140081e
@ -18,13 +18,17 @@ if [ -d ../jieba2 ]; then
|
||||
rm -rf ../jieba2
|
||||
fi
|
||||
fi
|
||||
git checkout master
|
||||
if ! git checkout jieba3k; then
|
||||
exit 1
|
||||
fi
|
||||
cp -r . ../jieba2
|
||||
git checkout jieba3k
|
||||
cd ../jieba2
|
||||
if ! git checkout master; then
|
||||
exit 1
|
||||
fi
|
||||
# Here starts auto conversion.
|
||||
echo Converting jieba2 to Python3 ...
|
||||
find . -type f -name '*.py' \! -path '*/build/*' \! -name 'prob_*.py' \! -name 'char_state_tab.py' -exec $PYTHON2TO3 -w -n {} +
|
||||
find . -type f \! -path '*/build/*' -a \( -name 'prob_*.py' -o -name 'char_state_tab.py' \) -exec sed -i "s/u'\\\u/'\\\u/g" {} \;
|
||||
patch -p0 <2to3.diff
|
||||
patch -p0 -s <../jieba/test/2to3.diff
|
||||
echo Done. Compare jieba and jieba2 to manually port.
|
||||
|
Loading…
x
Reference in New Issue
Block a user