Multithreaded 2-gram fake Trump tweets generator.
Folder containing text files in the format "part_N.txt".
(Where 'N' is a positive integer)
The parameters are:
| Parameter | Default | Description |
|---|---|---|
| FilesNumber | 208 | The number of files in the "part_X.txt" format |
| ThreadsNumber | 16 | The number of threads in the threadpool |
There are as many jobs as there are files. A job represents an active thread within the threadpool.
Each job contains:
The stream generated by the 1st thread is used as input by the 2nd thread.
Module allowing to read the content of a file.
Module allowing the line by line parsing of a file.
These lines are then split into words.
These words are then combined to form sentences.
Each word, of each sentence, is finally sent to the prediction dictionary.
The parameters are:
| Parameter | Default | Description |
|---|---|---|
| BreakList | . : - ( ) [ ] { } , '! ? | The end characters of the sentence |
| ToRemove | TBD | Not used |
Module for saving words related to one (1) or two (2) words.
-
(1) prediction based on a 1-gram structure The dictionary key is composed of one word.
-
(2) prediction based on a 2-gram structure The dictionary key is composed of two words.
The keys are linked to a prediction dictionary.
- The key -> a word
- The value -> a number of occurrences
Allows the user to insert a word that will be used as a basis for prediction.
Buttons are generated to allow the user to choose a prediction based the last word (1-gram) or the last 2 words (2-gram).
At any time the user can create a new sentence by clicking on "NEXT".