Beispiel #1
0
        static string NumerizeLongScale(long r, string s)
        {
            string numerizedInput = null;

            try
            {
                numerizedInput = Numerizer.Numerize(s, true);
            }
            catch (Exception ex)
            {
                throw new Exception(
                          String.Format(
                              "Test case: {0} => {1} :: {2}", s, r, ex.Message),
                          ex);
            }
            return(numerizedInput);
        }
Beispiel #2
0
        static string Numerize(int r, string s, string culture = "en")
        {
            Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(culture);

            string numerizedInput = null;

            try
            {
                numerizedInput = Numerizer.Numerize(s);
            }
            catch (Exception ex)
            {
                throw new Exception(
                          String.Format(
                              "Test case: {0} => {1} :: {2}", s, r, ex.Message),
                          ex);
            }
            return(numerizedInput);
        }
Beispiel #3
0
        private static string Numerize(int r, string s)
        {
            string numerizedInput = null;

            try
            {
                numerizedInput = Numerizer.Numerize(s);
            }
            catch (Exception ex)
            {
                throw new Exception(
                          string.Format(
                              "Test case: {0} => {1} :: {2}",
                              s,
                              r,
                              ex.Message),
                          ex);
            }

            return(numerizedInput);
        }
Beispiel #4
0
 public void test_edges_in_french()
 {
     Assert.Equal(
         "27 Oct 2006 7h30", Numerizer.Numerize("27 Oct 2006 7h30"));
 }
Beispiel #5
0
 public void test_edges()
 {
     Assert.Equal(
         "27 Oct 2006 7:30am", Numerizer.Numerize("27 Oct 2006 7:30am"));
 }
Beispiel #6
0
 public static string Numerize(this string @this, bool intendingTime)
 {
     return(Numerizer.Numerize(@this, intendingTime));
 }
 public static string Numerize(this string @this)
 {
     return(Numerizer.Numerize(@this));
 }