Giter VIP home page Giter VIP logo

Comments (4)

lpla avatar lpla commented on May 28, 2024

The string "url " does not match the if sentence. If you test this in bash it will return 1:

echo "url " | grep '\s' | wc -l

I think the "if" is working as intended (but it could be coded in a better way).

from bitextor.

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

The command you provided return 1, that is to say it matches; in other words, it indicate that the "url " contains the '\s' character (Null character) and the grep command can find it and have one return ; and in line 888 of the bitextor.sh script, the logical meaing is : if the command $(echo $line | grep '\s' | wc -l) return 0, that means the $line doesn't meet the correct format(In other words, if it return 1,that is to say it meet the correct format, but "url " isn't the correct format but it also will return 1).

from bitextor.

lpla avatar lpla commented on May 28, 2024

The example "url " has a correct format. The expression matches because the format is the one we expect: data TAB data. I agree with you that data in the fields are not right, because the second field is empty in our example (field 1: url, fields 2: "". But we are not checking the fields data here, we are only checking format, and, again, the format is correct, so the 'if' works as intended.

If you are worried about the fields content, I want you to know that they are checked and managed in the Python scrips, raising exceptions if a path or URL is not right. Again, in our example, it will raise an exception saying that the ETT is empty or not found.

Thanks for your feedback and don't hesitate to ask or make a pull request anytime.

from bitextor.

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

Oh, I see. Thanks 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.