Repository navigation
0.3.9
A patch release of anyTS, the language-independent core of the text statistics libraries ruTS (Russian) and esTS (Spanish).
Requirements
- Python 3.11 or newer.
- spaCy 3.8.15 or newer within 3 (new upper bound).
- numpy 1.26, pandas 2.1, scipy 1.11, matplotlib 3.8 and graphviz 0.20.3 or newer.
pip install anytsAdded
anyts.utils.check_bool(value, what). It checks a switch, and a numpybool_passes too. Now these switches raiseParameterErrorfor a value that is not abool:normalizeofBasicStats;filter_punct,filter_nums,use_lexemesandlowercaseofWordsExtractor;lowercaseandwithin_wordsofCharNgramsExtractor;by_lemmaandignore_caseofkwic.
anyts.utils.is_token(value). It checks whether a value is a spaCyTokenwithout importing spaCy, asis_doc,is_spanandis_languagedo.
Behaviour changes
SyntaxStatskeeps noDocof the user.sentsholds the tokens of a copy of theDocwithout its tensor and user data, and a pickle stores the compressed bytes of that copy.- On 30k characters, a pickle goes from 885 KB to 141 KB.
- A component no longer makes a reference cycle through the
Doc. - A pickle of 0.3.8 does not load on 0.3.9.
- Clauses.
- Some models attach the infinitive of a periphrasis as
conjorcsubj(Tiene que intentar salir). The walk now goes up through such an infinitive, so the infinitive under it keeps its clause. is_predicateaccepts a word with a copula (cop). In a language that drops the subject, a coordinated nominal predicate (y estaba cansado) now heads its clause.- On the texts of esTS, clause counts only went up.
- Some models attach the infinitive of a periphrasis as
- Connectors.
- The rules of
ConnectorMatcherfind a connector by its normalized form, however the dictionary or the list writes it.Connector.textstays as the dictionary writes it. find(breaks=)rejects a position that is not that of a word after the first, withParameterError.is_subordinatorraisesSourceTypeErrorfor a value that is not aConnector.
- The rules of
- Token predicates. These raise
SourceTypeErrorfor a value that is not aToken:predicate_form,is_predicate,is_clause_head,is_infinitive_clause,is_subordinate_clause_head,is_infinitive_clause_head,is_passive,has_agentandis_agentless. describegivesNonefor any key of a dictionary statistic (c_lengths_4,pos_ADJ), not only for the keys of this object.MESSAGESis read-only (aMappingProxyType).- An assignment no longer changes the messages of every class.
- A library builds its own mapping,
MappingProxyType({**MESSAGES, **own}).
bootstrap_median_difftakes labels of one kind only, strings or numbers.
Quality
- 2170 tests pass with 100% line and branch coverage.
- CI runs on Python 3.11–3.14 on Linux, Windows and macOS, plus a job with the lowest versions of the dependencies.
Links
- Documentation: https://sergeyshk.github.io/anyTS/
- PyPI: https://pypi.org/project/anyts/
- Changes: 0.3.8...0.3.9