Giter VIP home page Giter VIP logo

Comments (7)

mespla avatar mespla commented on May 28, 2024

from bitextor.

IT-coach-666 avatar IT-coach-666 commented on May 28, 2024

Thanks for your reply.
Today I did an experiment on the sample dictionary (en-ca.dic)
I wrote a bash script to detect the following two regex expression, and then I found a problem described in the following():
tail -n +2 en-ca.dic | sed -r 's/^([^\s]+)\t([^\s]+)$/\2 @ \1/g' > output_s
tail -n +2 en-ca.dic | sed -r 's/^([^\S]+)\t([^\S]+)$/\2 @ \1/g' > output_S

the bash script described as follow (regex_test.sh):
TEST_DIC_NAME=en-ca.dic
tail -n +2 ${TEST_DIC_NAME} | sed -r 's/^([^\S]+)\t([^\S]+)$/\2 @ \1/g' > S_out_${TEST_DIC_NAME}
tail -n +2 ${TEST_DIC_NAME} | sed -r 's/^([^\s]+)\t([^\s]+)$/\2 @ \1/g' > s_out_${TEST_DIC_NAME}
echo "===================================="
echo "the total lines of the dictionary:"
wc -l ${TEST_DIC_NAME}
echo "===================================="
echo "the s_out_${TEST_DIC_NAME} result:"
echo "total lines containing the @ character:"
grep @ s_out_${TEST_DIC_NAME} | wc -l
echo "total lines not containing the @ character:"
grep -v @ s_out_${TEST_DIC_NAME} | wc -l
echo "===================================="
echo "the S_out_${TEST_DIC_NAME} result:"
echo "total lines containing the @ character:"
grep @ S_out_${TEST_DIC_NAME} | wc -l
echo "total lines not containing the @ character:"
grep -v @ S_out_${TEST_DIC_NAME} | wc -l

Do the above test, and I found that using the following may have better result:
"tail -n +2 en-ca.dic | sed -r 's/^([^\S]+)\t([^\S]+)$/\2 @ \1/g' > output_S "
But I don't konw the reason.

from bitextor.

mespla avatar mespla commented on May 28, 2024

from bitextor.

IT-coach-666 avatar IT-coach-666 commented on May 28, 2024

Thanks for your reply.
I see what you said, and I also confused about that.
And I do the expriment as you said : replace \s with [:space:] in the en-ca.dic , it really work properly.
But I do the expriment in my own dictionary: en-vi.dic , the result also very bad. I don't know why.
Following are my en-vi.dic file:

en-vi.txt

from bitextor.

mespla avatar mespla commented on May 28, 2024

from bitextor.

lpla avatar lpla commented on May 28, 2024

This is now integrated in masterand 6.x series branch. Release 6.0.1 incoming. If you find anything else wrong with this new expression, please, reopen the issue. Thanks for all your feedback!

from bitextor.

IT-coach-666 avatar IT-coach-666 commented on May 28, 2024

Thank you very much~

from bitextor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.