Skip to main content

Creates an object with a list of each unique word in a plaintext document.

Project description

uniqueWordList

Creates an object with a list of each unique word in a plaintext document.

Install with pip install uniqueWordList

Takes the file path as its input. var.wordCount returns the list's length, var.wordList returns the list itself.

import uniqueWordList

test_text = uniqueWordList.getList('someBook.txt', alphanumeric = True)

print(test_text.wordCount)

with open('asdf.txt', 'w') as output:
  output.write(str(test_text.wordList))

Strengths, weaknesses, and things to consider

Setting alphanumeric to True will count any number or alphanumeric combo (ex: 1b, 1e5). Some of these will probably not be real words. It is set to False by default.

Speaking of things that aren't real words: if there are any typos or deliberate misspellings they will be counted as separate words. Similarily, the plural versions of words will be counted as their own words as well.

Same goes for people being cut off mid-word. "You stu-" will be counted as ['you', 'stu']

Because of how the list is made you might also find an entry like ['a', 'b', 'c'] when an author spells out "now I know my A,B,Cs" or similar text.

Legalese is also common. ['trademarkcopyright', 'wwwgutenbergorg'] were both common in lists during tests. The easiest way to avoid these types of words may be to just delete those segments from your text docs manually.

Overall the accuracy of the lists generated depends entirely on the author's writing style and the quality of the document. Your mileage may vary.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uniquewordlist-0.0.1.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uniquewordlist-0.0.1-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

Details for the file uniquewordlist-0.0.1.tar.gz.

File metadata

  • Download URL: uniquewordlist-0.0.1.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for uniquewordlist-0.0.1.tar.gz
Algorithm Hash digest
SHA256 1f4bddb0c8240031aaa3c040de0217abe9a9c313e064eeaf9f8baeab4f95a32c
MD5 3a5e83f681342856fb75df67a9aa557b
BLAKE2b-256 1d5d9b45b3766886b11d7b590b4d12b4cd94f8173ac4cdf6b437bdb18474e313

See more details on using hashes here.

File details

Details for the file uniquewordlist-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: uniquewordlist-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for uniquewordlist-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 254f5e1f476ddc145dd087527249b408b81f36e7d5b82a5bfb1d093e22ce7e78
MD5 0afd6b8970a538e52b2ace5b77520f79
BLAKE2b-256 44b8ec888453143dfe12c903d8c49ff83a20212f1d297f39cd6ef77993795490

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page