Re: [cellml-discussion] Proposal: Standardised CellML real number format

2007-09-19 Thread Andrew Miller
Alan Garny wrote:
>>> Therefore, I think that we need to restrict it down to something like
>>> (in regular expression syntax):
>>>
>>> (\-|)[0-9]+(\.[0-9]+|)(E(-|)[0-9]+|e(-|)[0-9]+|)
>>>
>>> In other words:
>>>   An optional - , followed by 1 or more digits from 0 to 9, followed by
>>> an optional decimal point (not a comma or momayyez) followed by an
>>> optional E or e character with a possible sign and one or more digits
>>> after it.
>>>   
>> probably best to allow for an optional '+' or '-' both at the start and
>> following the exponent character.
>> 
>
> So something like (assuming my use of the syntax is correct):
>
> (\+|\-|)[0-9]+(\.[0-9]+|)((E|e)(\+|\-|)[0-9]+)
>
> Note that I have also 'simplified' the exponent part.
>   
I don't think the exponent should be mandatory, however, as this would 
break the majority of models in use.

Best regards,
Andrew

___
cellml-discussion mailing list
cellml-discussion@cellml.org
http://www.cellml.org/mailman/listinfo/cellml-discussion


Re: [cellml-discussion] Proposal: Standardised CellML real number format

2007-09-19 Thread Alan Garny
> > Therefore, I think that we need to restrict it down to something like
> > (in regular expression syntax):
> >
> > (\-|)[0-9]+(\.[0-9]+|)(E(-|)[0-9]+|e(-|)[0-9]+|)
> >
> > In other words:
> >   An optional - , followed by 1 or more digits from 0 to 9, followed by
> > an optional decimal point (not a comma or momayyez) followed by an
> > optional E or e character with a possible sign and one or more digits
> > after it.
> 
> probably best to allow for an optional '+' or '-' both at the start and
> following the exponent character.

So something like (assuming my use of the syntax is correct):

(\+|\-|)[0-9]+(\.[0-9]+|)((E|e)(\+|\-|)[0-9]+)

Note that I have also 'simplified' the exponent part.

Alan.

___
cellml-discussion mailing list
cellml-discussion@cellml.org
http://www.cellml.org/mailman/listinfo/cellml-discussion


Re: [cellml-discussion] Proposal: Standardised CellML real number format

2007-09-18 Thread Andrew Miller
David Nickerson wrote:
>> Therefore, I think that we need to restrict it down to something like 
>> (in regular expression syntax):
>>
>> (\-|)[0-9]+(\.[0-9]+|)(E(-|)[0-9]+|e(-|)[0-9]+|)
>>
>> In other words:
>>   An optional - , followed by 1 or more digits from 0 to 9, followed by 
>> an optional decimal point (not a comma or momayyez) followed by an 
>> optional E or e character with a possible sign and one or more digits 
>> after it.
>> 
>
> probably best to allow for an optional '+' or '-' both at the start and 
> following the exponent character.
>
> I have no experience, but does using a non-EN locale make it difficult 
> to enter numbers with a decimal point?
>   
Based on 
http://en.wikipedia.org/w/index.php?title=Keyboard_layout&oldid=158242943 
it looks like we are okay for the European, South American, and Asian 
keyboard layouts. I am not sure about the Arabic and Armenian layouts.

However, I think that programs can present the numbers to the user in 
whatever format they like, as long as the specification describes that 
they are stored in a consistent way. Users who can't enter the full stop 
/ period character who want to edit a CellML file in a text editor will 
have other problems anyway, e.g. they couldn't type in the CellML 
namespace or the XML version (or any cn elements in the MathML).

Best regards,
Andrew
> ___
> cellml-discussion mailing list
> cellml-discussion@cellml.org
> http://www.cellml.org/mailman/listinfo/cellml-discussion
>   

___
cellml-discussion mailing list
cellml-discussion@cellml.org
http://www.cellml.org/mailman/listinfo/cellml-discussion


Re: [cellml-discussion] Proposal: Standardised CellML real number format

2007-09-18 Thread David Nickerson
> Therefore, I think that we need to restrict it down to something like 
> (in regular expression syntax):
> 
> (\-|)[0-9]+(\.[0-9]+|)(E(-|)[0-9]+|e(-|)[0-9]+|)
> 
> In other words:
>   An optional - , followed by 1 or more digits from 0 to 9, followed by 
> an optional decimal point (not a comma or momayyez) followed by an 
> optional E or e character with a possible sign and one or more digits 
> after it.

probably best to allow for an optional '+' or '-' both at the start and 
following the exponent character.

I have no experience, but does using a non-EN locale make it difficult 
to enter numbers with a decimal point?
___
cellml-discussion mailing list
cellml-discussion@cellml.org
http://www.cellml.org/mailman/listinfo/cellml-discussion


[cellml-discussion] Proposal: Standardised CellML real number format

2007-09-18 Thread Andrew Miller
Hi all,

The CellML Specification does not define the format in which real 
numbers will be represented at all (it just says, for initial_value: 
"The value of the |initial_value| attribute may be a real number or a 
variable"). The MathML specification defines
"A real number is presented in decimal notation. Decimal notation 
consists of an optional sign ("+" or "-") followed by a string of digits 
possibly separated into an integer and a fractional part by a "decimal 
point". Some examples are 0.3, 1, and -31.56. If a different |base| is 
specified, then the digits are interpreted as being digits computed to 
that base."

This means that there are no constraints at all on how initial values 
can be represented. It is common practice in current CellML processing 
to use representations in standard notation, using formats like 1E8. 
Therefore, I think that we need to restrict it down to something like 
(in regular expression syntax):

(\-|)[0-9]+(\.[0-9]+|)(E(-|)[0-9]+|e(-|)[0-9]+|)

In other words:
  An optional - , followed by 1 or more digits from 0 to 9, followed by 
an optional decimal point (not a comma or momayyez) followed by an 
optional E or e character with a possible sign and one or more digits 
after it.

Are there any opinions about this? I will re-raise this at the next 
CellML meeting next Wednesday so we can summarise any discussion which 
has occurred on the mailing lists, so please send your comments before then.

Best regards,
Andrew

___
cellml-discussion mailing list
cellml-discussion@cellml.org
http://www.cellml.org/mailman/listinfo/cellml-discussion