|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hibernate.search.test.util.textbuilder.SentenceInventor
public class SentenceInventor
Test utility meant to produce sentences of a randomly generated language, having some properties of natural languages. The goal is to produce sentences which look like a western text, but are not. All sentences from the same SentenceInventor will share a limited dictionary, making the frequencies suitable to test with Lucene. Sentences produced depend from the constructor arguments, making the output predictable for testing purposes.
| Constructor Summary | |
|---|---|
SentenceInventor(long randomSeed,
int dictionarySize)
|
|
| Method Summary | |
|---|---|
static void |
main(java.lang.String[] args)
|
java.lang.String |
nextPeriod()
Combines a random (gaussian) number of sentences in a period, using some punctuation symbols and capitalizing first char, terminating with dot and newline. |
java.lang.String |
nextSentence()
Builds a sentence concatenating terms from the generated dictionary and spaces |
char |
randomCharacter()
|
java.lang.String |
randomString()
Produces a randomly generated String, using only western alphabet characters and selecting the length as a normal distribution of natural languages. |
java.lang.String |
randomString(int length)
|
java.lang.String |
randomTerm()
Produces a random String, which might be lowercase, completely uppercase, or uppercasing the first char (randomly selected) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SentenceInventor(long randomSeed,
int dictionarySize)
randomSeed - the seed to use for random generatordictionarySize - the number of terms to insert in the dictionary used to build sentences| Method Detail |
|---|
public char randomCharacter()
public java.lang.String randomString(int length)
length - the desired length
public java.lang.String randomString()
public java.lang.String randomTerm()
public java.lang.String nextSentence()
public java.lang.String nextPeriod()
public static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||