Skip to content

Lymero/TrumpTweetsGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Structure

Multithreaded 2-gram fake Trump tweets generator.

tweets

Folder containing text files in the format "part_N.txt".
(Where 'N' is a positive integer)

main.oz

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:

  • 1 thread dedicated to reading reader
  • 1 thread for parsing parser

The stream generated by the 1st thread is used as input by the 2nd thread.

Reader.oz

Module allowing to read the content of a file.

Parser.oz

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

PredictionDictionary.oz

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

GUI.oz

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".

About

Multi-threaded 2-gram Donald Trump's tweets builder

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors