Skip to content

if "-" in word and word[0] != "-": TypeError: argument of type 'float' is not iterable #41

@dzianisv

Description

@dzianisv

I tried to vocalize the book https://library.lol/main/7AB96C0626A64D7AFA33F68DC6D97CE3.

--- attribution: 111.759 seconds ---
--- name coref: 13.472 seconds ---
--- coref: 110.698 seconds ---
--- TOTAL (excl. startup): 382.830 seconds ---, 258918 words
deleted file: /Users/engineer/Downloads/Neil Howe - The Fourth Turning Is Here _ What the Seasons of History Tell Us about How and When This Crisis Will End-Simon & Schuster (2023).txt because its not needed anymore after the ebook convertsion to txt
Success, File processed successfully!
Processed 3306 lines.
Removed 0 problematic lines.
Wrote 3306 lines back to the file.
Saved nonquotes.csv to Working_files/Book/non_quotes.csv
All processing complete!
Traceback (most recent call last):
  File "/Volumes/Backup/Users/engineer/workspace/VoxNovel/gui_run.py", line 696, in <module>
    main()
  File "/Volumes/Backup/Users/engineer/workspace/VoxNovel/gui_run.py", line 691, in main
    process_files(q_file, matching_entities_files[0])
  File "/Volumes/Backup/Users/engineer/workspace/VoxNovel/gui_run.py", line 619, in process_files
    if is_pronoun(mention):
  File "/Volumes/Backup/Users/engineer/workspace/VoxNovel/gui_run.py", line 596, in is_pronoun
    tagged_word = nltk.pos_tag([word])
  File "/Users/engineer/miniconda3/envs/VoxNovel/lib/python3.10/site-packages/nltk/tag/__init__.py", line 169, in pos_tag
    return _pos_tag(tokens, tagset, tagger, lang)
  File "/Users/engineer/miniconda3/envs/VoxNovel/lib/python3.10/site-packages/nltk/tag/__init__.py", line 126, in _pos_tag
    tagged_tokens = tagger.tag(tokens)
  File "/Users/engineer/miniconda3/envs/VoxNovel/lib/python3.10/site-packages/nltk/tag/perceptron.py", line 194, in tag
    context = self.START + [self.normalize(w) for w in tokens] + self.END
  File "/Users/engineer/miniconda3/envs/VoxNovel/lib/python3.10/site-packages/nltk/tag/perceptron.py", line 194, in <listcomp>
    context = self.START + [self.normalize(w) for w in tokens] + self.END
  File "/Users/engineer/miniconda3/envs/VoxNovel/lib/python3.10/site-packages/nltk/tag/perceptron.py", line 303, in normalize
    if "-" in word and word[0] != "-":
TypeError: argument of type 'float' is not iterable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions