Re: [FT] FTRange "at most"

Paul J. Lucas wrote:
> From section 3.6.3 of the spec:
> 
>> If "at most" is specified, then the range is the half-closed interval (unbounded, M].
>> 'at most 1' specifies the range (unbounded, 1].
> 
> I would assume that neither M or N can be negative,

On the contrary, both can be negative, though I expect such values will 
have limited usefulness. The spec merely requires that: "Each one of the 
AdditiveExpr specified in an FTRange is converted as though it were an 
argument to a function with the expected parameter type of xs:integer."

> so what does it mean to have
> "unbounded" for the lower part of the interval?  Does:
> 
> 	(unbounded,1]
> 
> really mean:
> 
> 	[0,1]
> 
> ?

When the FTRange appears in an FTTimes (e.g., "occurs at most 1 times"), 
I believe the two interpretations are effectively equivalent, because 
there can't be a negative number of occurrences of something. (The case 
where the FTRange appears in an FTThesaurusID is probably similar, but 
that might be implementation-specific.)

However, when the FTRange occurs in an FTDistance (e.g., "distance at 
most 1 words"), the two interpretations are not equivalent, because a 
distance *can* be negative. (See the Note in section 4.1 for two 
examples of this.) The "(unbounded,1]" interpretation accepts these 
cases (as intended), while the suggested "[0,1]" interpretation would not.

-Michael

Received on Friday, 9 July 2010 21:47:57 UTC