Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
0
 public void test_edges_in_french()
 {
     Assert.Equal(
         "27 Oct 2006 7h30", Numerizer.Numerize("27 Oct 2006 7h30"));
 }
Ejemplo n.º 5
0
 public void test_edges()
 {
     Assert.Equal(
         "27 Oct 2006 7:30am", Numerizer.Numerize("27 Oct 2006 7:30am"));
 }
Ejemplo n.º 6
0
 public static string Numerize(this string @this, bool intendingTime)
 {
     return(Numerizer.Numerize(@this, intendingTime));
 }
Ejemplo n.º 7
0
 public static string Numerize(this string @this)
 {
     return(Numerizer.Numerize(@this));
 }