|
|
@ -22,13 +22,15 @@ import os |
|
|
|
import spacy |
|
|
|
|
|
|
|
parser = argparse.ArgumentParser(description='Generate a novel using Markov chains.') |
|
|
|
parser.add_argument('word_file', help='File used for word selection') |
|
|
|
parser.add_argument('pos_file', help='File used to build part-of-speech Markov chain') |
|
|
|
parser.add_argument('word_file', help='file used for word selection') |
|
|
|
parser.add_argument('pos_file', help='file used to build part-of-speech Markov chain') |
|
|
|
parser.add_argument('-s', '--seed', type=int, help='seed for random number generator') |
|
|
|
args = parser.parse_args() |
|
|
|
|
|
|
|
nlp = spacy.load('en_core_web_sm') |
|
|
|
|
|
|
|
seed = 12345 |
|
|
|
seed = args.seed or 12345 |
|
|
|
|
|
|
|
rng = np.random.default_rng(seed) |
|
|
|
|
|
|
|
words_text = '' |
|
|
|