Skip to content

0.6.1

Choose a tag to compare

@SergeyShk SergeyShk released this 04 Oct 14:45
b5bbfd5

A patch release of esTS: the library moves to anyTS 0.2.8, the language-independent core of text statistics shared with ruTS, and fixes two gaps found on the way.

Requires Python 3.11 or newer. Install with pip install -U pyests and import with import ests. The core is now anyts>=0.2.8,<0.3, installed with the package.

Incompatible changes

The public classes and functions keep their names and signatures.

  • anyTS 0.2.8 or newer within 0.2 is required.
  • ests.utils.count_words_by_spans is the function of the core (anyts.utils.count_words_by_spans), with the same results. It also checks its arguments: spans that are not a sequence (an iterator, a generator, dict_keys, a 2-D array) raise SourceTypeError where 0.6.0 looped over them, and positions that are not a sequence raise SourceTypeError instead of a bare TypeError.
  • keyness with a FreqDict checks its parameters and target before it reads the dictionary. A wrong measure, top_n or min_freq raises ParameterError, and a target that is not a list of words or a mapping of frequencies raises SourceTypeError, at once and also when the dictionary is not downloaded, where they used to raise DatasetNotFoundError.

Numbers

The numbers of 0.6.0 are kept except for D₂ of Carroll in dispersion, which the core computes without rounding noise: on a fixed set of texts 2 of 4620 results changed, eight values of carroll_d2: four in the last digit, one from 4.5e-17 to 0.0 and three from -0.0 to 0.0. χ² and BIC of keyness give no -0.0 either.

Fixes

  • subtree_len, and with it the participle and gerund clauses of SyntaxStats, returns on a broken parse whose heads form a loop instead of never returning; on a tree the counts do not change.
  • The participle and gerund layers of the highlighting return on such a parse as well, and count the words of a clause as SyntaxStats does. On 40 texts of SpanishLiterature all fragments are the same as in 0.6.0.

Quality

  • 1812 tests pass with 100% line and branch coverage.
  • ruff and mypy are clean.
  • The numbers of all statistics were compared with 0.6.0 on a fixed set of texts; everything outside the change above is bitwise equal.

Links