[jira] [Commented] (TEXT-25) Add a duration parser
[ https://issues.apache.org/jira/browse/TEXT-25?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16364675#comment-16364675 ] ASF GitHub Bot commented on TEXT-25: Github user asfgit closed the pull request at: https://github.com/apache/commons-text/pull/24 > 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 >Priority: Minor > > 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 (v7.6.3#76005)
[jira] [Commented] (TEXT-25) Add a duration parser
[ https://issues.apache.org/jira/browse/TEXT-25?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16017615#comment-16017615 ] Gary Gregory commented on TEXT-25: -- I agree with @britter, this feels out of scope. > 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.x > > > 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)
[jira] [Commented] (TEXT-25) Add a duration parser
[ https://issues.apache.org/jira/browse/TEXT-25?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16017610#comment-16017610 ] Rob Tompkins commented on TEXT-25: -- I think that was similar to the point that Benedikt was trying to make here: https://github.com/apache/commons-text/pull/24 > 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.x > > > 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)
[jira] [Commented] (TEXT-25) Add a duration parser
[ https://issues.apache.org/jira/browse/TEXT-25?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16017607#comment-16017607 ] Gary Gregory commented on TEXT-25: -- We should make it clear that this is an alternative solution to using the ISO 8601 format strings with Java 8 or Joda-Time which give you all the level of granularity you need. > 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.x > > > 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)
[jira] [Commented] (TEXT-25) Add a duration parser
[ https://issues.apache.org/jira/browse/TEXT-25?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16007528#comment-16007528 ] Bruno P. Kinoshita commented on TEXT-25: Yup, it provides a way to extend it, but I would suggest offering a few implementations, as in Commons CSV parser. The default could be English, but maybe we could provide French, Spanish, and Portuguese too. And maybe provide another strategy that would simply build the parser from a locale. We could provide ResourceBundles if there are not some available already. Then simply match ResourceBundle against the locale and create the parser. Ideally, the same approach for internationalization in Commons Text for the Duration Parser would be re-used in the Human Names Parser, and for future modules that may require such feature. > 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)
[jira] [Commented] (TEXT-25) Add a duration parser
[ 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)
[jira] [Commented] (TEXT-25) Add a duration parser
[ https://issues.apache.org/jira/browse/TEXT-25?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15968372#comment-15968372 ] Bruno P. Kinoshita commented on TEXT-25: > btw, any plan of merge this in master and release date ? First we need to have a solid implementation, covering issues raised in the past (e.g. internationalization/locale-awareness, configurable parser). Then submit a pull request, and check with the rest of the developers/community if the pull request looks good to be added to 1.1. Once it is done, we can start discussing a release date :-) > 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)
[jira] [Commented] (TEXT-25) Add a duration parser
[ https://issues.apache.org/jira/browse/TEXT-25?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15968003#comment-15968003 ] Amey Jadiye commented on TEXT-25: - Cool, i'm started working on this new features, will keep you posted. btw, any plan of merge this in master and release date ? > 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)
[jira] [Commented] (TEXT-25) Add a duration parser
[ https://issues.apache.org/jira/browse/TEXT-25?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15966992#comment-15966992 ] Bruno P. Kinoshita commented on TEXT-25: Hi [~ameyjadiye], we decided to release 1.0 first, including mainly edit distances and classes migrated from Apache Commons Lang, before adding new features such as the duration parser. If you would like to submit another pull request based on https://github.com/apache/commons-text/pull/24, or maybe keep a fork to compare with the current PR, it might make it easier to review your changes too. I like these features too, by the way. We might have to think about a good way to support multiple currencies like NZD 1.000,00, and BRL 1,000.00 (one thousand new zealand dollars, and one thousand brazilian reals), support different locales (i.e. BRL 1,000.00 uses commas for thousand separator, and dots for cents, and it could be translated as "1000 reais" in Brazilian Portuguese), etc. > 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)
[jira] [Commented] (TEXT-25) Add a duration parser
[ https://issues.apache.org/jira/browse/TEXT-25?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15966464#comment-15966464 ] Amey Jadiye commented on TEXT-25: - Hi [~kinow] Is this merged to TEXT code ? if not let me know show stopper things and i can complete that, after that I wish to add few more matrix like numbers and amount (money) Ex. 1k stringyfy - one thousand. parse - 1000 $1k - stringyfy - one thousand doller parse - $1,000 > 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)
[jira] [Commented] (TEXT-25) Add a duration parser
[ https://issues.apache.org/jira/browse/TEXT-25?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15799714#comment-15799714 ] Jean Champémont commented on TEXT-25: - I created a PR for this: https://github.com/apache/commons-text/pull/24 > 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.4#6332)
[jira] [Commented] (TEXT-25) Add a duration parser
[ https://issues.apache.org/jira/browse/TEXT-25?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15647219#comment-15647219 ] Jean Champémont commented on TEXT-25: - Yes, I confirm I'm OK to donate the code of gunip to the Apache commons project. > 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 > > 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.4#6332)
[jira] [Commented] (TEXT-25) Add a duration parser
[ https://issues.apache.org/jira/browse/TEXT-25?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15646978#comment-15646978 ] Bruno P. Kinoshita commented on TEXT-25: Asked Jean via e-mail if he would be keen to donate the code to ASF, and he said he'd be OK with that :-D Will ask him to reply here or in the mailing list confirming. His code is licensed under the Apache License, so I assume it will be OK. There are no dependencies in gunip, and the code seems to have inspiration in Juration, but no simple copy and paste from any other code base. > 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 > > 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.4#6332)