3 ms·
> But your assertion was that this was an easy problem solved with just a few lines of shell code. Where did I assert that? > I can't say that it is impossibl
by pdonis 14y ago
> But your assertion was that this was an easy problem solved with just a few lines of shell code.
Where did I assert that?
> I can't say that it is impossible to write a shell script to count words in a text written in Arabic script, but it doesn't seem easy.
Is there a definition of what counts as a "letter" in Arabic script? That is, which Unicode code points correspond to letters? And does Arabic share the convention that a "word" is a sequence of letters delimited by non-letters?
If the answers to those questions are "yes", then the extension of the algorithm already presented to handle Arabic is straightforward; it's just a matter of substituting the Arabic definition of "letters" for the ASCII definition. (With, as I said in my previous comment, the additional issue of determining the encoding of the input and output.)
If some of the answers to the above questions are "no", then you have an issue with the problem specification, not with the algorithm you're going to use to solve it.