Update to 2.0.0 #1
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR bumps the version to 2.0.0 to reflect significant and non-backward-compatible changes. The primary goals of this update are to simplify the library's architecture, remove external dependencies for better license compliance, and improve the accuracy of the readability metrics.
Changes
Architecture change — class to functions:
The library has been refactored from a class-based (
readability()) to a direct function-based API. Users can now import and call functions likeflesch_kincaid_grade(text)directly, making the library more straightforward and Pythonic to use. This breaking change is the main driver for the v2.0.0 major version bump.Removed
cmudictdependency for MIT license compliance:The external
cmudictpackage has been removed as a dependency to ensure the project can be maintained under the MIT license. The CMU Pronouncing Dictionary is now bundled directly with the package. A local copy of thecmudict.dictfile is now included in the package resources. A new internal function,_load_cmu_dict, has been implemented to parse this file, making the library self-contained. The CMUdict license has been added toLICENSEto give proper attribution.Corrected readability calculations:
Several readability formulas have been reviewed and corrected to fix errors and align more closely with their standard definitions.
Code and comment cleanup:
The codebase has been cleaned up with updated comments, improved function signatures, and better type hinting.
Removed verbose mode:
Verbose mode wasn't very useful. Removed it for ease of future development and ease of use.