private static void GenRandom(Org.Apache.Hadoop.IO.Text t, int len, StringBuilder
                               sb)
 {
     sb.Length = 0;
     for (int i = 0; i < len; ++i)
     {
         sb.Append(Extensions.ToString(r.Next(26) + 10, 36));
     }
     t.Set(sb.ToString());
 }
Exemple #2
0
 private int GenerateSentence(Org.Apache.Hadoop.IO.Text t, int noWords)
 {
     sentence.Length = 0;
     --noWords;
     for (int i = 0; i < noWords; ++i)
     {
         sentence.Append(words[r.Next(words.Length)]);
         sentence.Append(" ");
     }
     if (noWords >= 0)
     {
         sentence.Append(words[r.Next(words.Length)]);
     }
     t.Set(sentence.ToString());
     return(sentence.Length);
 }