Re: Lack Of Definition Of A Valid Ratio (part of detailed review of common microsyntaxes)

Geoffrey Sneddon writes:

> The ratio subsection of common microsyntaxes does not do what the rest
> of the numbers do: define what a valid number is.

I agree that having a definition would be a good idea.

> Due to the algorithm returning at all sorts of places, it is rather
> complex to work out, but I think:
> [[
> A string is a valid ratio if it consists of either one of more  
> characters in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE  
> (9) followed by a denominator punctuation character (see table  
> below), or two valid unsigned integers separated by one or more  
> characters in Unicode character class Zs.
> ]]

That's wrong.  Your definition fails to allow these, which the algorithm
accepts and turns into a valid ratio:

* The relevance is 59%.
* In surveys 8 out of 10 cats prefer Vim.
* 0.849
* 3/4

It would be closer if you said:

* "contains" instead of "consists"

* "non-digit characters" instead of "characters in Unicode character
  class Zs".

* "one or two (but no more than two)" instead of "two" [the "(but no
  more than two)" part is only needed if "contains" is used]

But that's just off the top of my head, and I suspect it still doesn't
exactly describe what is permitted by the algorithm.


Received on Wednesday, 11 July 2007 12:13:46 UTC