[ 
https://issues.apache.org/jira/browse/TEXT-25?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16006816#comment-16006816
 ] 

Amey Jadiye commented on TEXT-25:
---------------------------------

[~kinow], i'm braking the task in smaller parts here, lets start with 
internationalisation, the implementation Jean have is pretty straight forward, 
assign the Strings to particulate unit and you are done, so example for second 
unit you give different titles of different language in a row (which can be 
made configurable) 
Ex.
* Seconds in English
* Secondes in French
* Segundos in Portuguese
* Secondi in Italian

and that's it,
{code:java}
public DurationParser() {
         super(Unit.UnitsBuilder.baseUnit(   "s", "sec", 
"second","Seconds","Secondes","Segundos","Secondi")
                 .addUnit(60               , "m(?!s)", "min", "minute")
                 .addUnit(60 * 60          , "h", "hr", "hour")
                 .addUnit(60 * 60 * 24     , "d", "dy", "day")
                 .addUnit(60 * 60 * 24 * 7 , "w", "wk", "week")
                 .addUnit(2628000          , "mth", "mo", "mon", "month")
                 .addUnit(31536000         , "y", "yr", "year")
             .build()
         );
     }
{code}

I want to know what else you are expecting here ?

> Add a duration parser
> ---------------------
>
>                 Key: TEXT-25
>                 URL: https://issues.apache.org/jira/browse/TEXT-25
>             Project: Commons Text
>          Issue Type: New Feature
>            Reporter: Bruno P. Kinoshita
>            Assignee: Bruno P. Kinoshita
>            Priority: Minor
>             Fix For: 1.1
>
>
> Duration parses interpret text such as *2 hours, 1 mn and 22sec*.
> Examples exist, such as https://github.com/jchampemont/gunip, written in 
> Javaby Jean Champémont, inspired by https://github.com/domchristie/juration 
> (JavaScript).



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to