whylabs-textstat


Namewhylabs-textstat JSON
Version 0.7.4 PyPI version JSON
download
home_pagehttps://github.com/whylabs/whylabs-textstat
SummaryCalculate statistical features from text
upload_time2024-07-11 19:52:35
maintainerNone
docs_urlNone
authorShivam Bansal, Chaitanya Aggarwal
requires_python>=3.6
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Whylabs fork of textstat

for main repo see: https://github.com/textstat/textstat

Modifications from main repo:
* replace the Pyphen dependency with syllapy.

[![PyPI](https://img.shields.io/pypi/v/textstat.svg)](https://pypi.org/project/whylabs-textstat/)
[![Downloads](https://img.shields.io/badge/dynamic/json.svg?url=https://pypistats.org/api/packages/whylabs-textstat/recent?mirrors=false&label=downloads&query=$.data.last_month&suffix=/month)](https://pypistats.org/packages/whylabs-textstat)

**Textstat is an easy to use library to calculate statistics from text. It helps determine readability, complexity, and grade level.**

<p align="center">
  <img width="100%" src="https://images.unsplash.com/photo-1457369804613-52c61a468e7d?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&h=400&q=80">
</p>
<p align="right">
  <sup>Photo by <a href="https://unsplash.com/@impatrickt">Patrick Tomasso</a>
  on <a href="https://unsplash.com/images/things/book">Unsplash</a></sup>
</p>

## Usage

```python
>>> import textstat

>>> test_data = (
    "Playing games has always been thought to be important to "
    "the development of well-balanced and creative children; "
    "however, what part, if any, they should play in the lives "
    "of adults has never been researched that deeply. I believe "
    "that playing games is every bit as important for adults "
    "as for children. Not only is taking time out to play games "
    "with our children and other adults valuable to building "
    "interpersonal relationships but is also a wonderful way "
    "to release built up tension."
)

>>> textstat.flesch_reading_ease(test_data)
>>> textstat.flesch_kincaid_grade(test_data)
>>> textstat.smog_index(test_data)
>>> textstat.coleman_liau_index(test_data)
>>> textstat.automated_readability_index(test_data)
>>> textstat.dale_chall_readability_score(test_data)
>>> textstat.difficult_words(test_data)
>>> textstat.linsear_write_formula(test_data)
>>> textstat.gunning_fog(test_data)
>>> textstat.text_standard(test_data)
>>> textstat.fernandez_huerta(test_data)
>>> textstat.szigriszt_pazos(test_data)
>>> textstat.gutierrez_polini(test_data)
>>> textstat.crawford(test_data)
>>> textstat.gulpease_index(test_data)
>>> textstat.osman(test_data)
```

The argument (text) for all the defined functions remains the same -
i.e the text for which statistics need to be calculated.

## Install

You can install textstat either via the Python Package Index (PyPI) or from source.

### Install using pip

```shell
pip install textstat
```

### Install using easy_install

```shell
easy_install textstat
```

### Install latest version from GitHub

```shell
git clone https://github.com/textstat/textstat.git
cd textstat
pip install .
```

### Install from PyPI

Download the latest version of textstat from http://pypi.python.org/pypi/textstat/

You can install it by doing the following:

```shell
tar xfz textstat-*.tar.gz
cd textstat-*/
python setup.py build
python setup.py install # as root
```

## Language support
By default functions implement algorithms for english language. 
To change language, use:

```python
textstat.set_lang(lang)
``` 

The language will be used for syllable calculation and to choose 
variant of the formula.

### Language variants
All functions implement `en_US` language. Some of them has also variants 
for other languages listed below. 

|  Function                   | en | de | es | fr | it | nl | pl | ru |
|-----------------------------|----|----|----|----|----|----|----|----|
| flesch_reading_ease         | ✔  | ✔  | ✔  | ✔  | ✔  | ✔  |    | ✔  |
| gunning_fog                 | ✔  |    |    |    |    |    | ✔  |    |

#### Spanish-specific tests
The following functions are specifically designed for spanish language.
They can be used on non-spanish texts, even though that use case is not recommended.

```python
>>> textstat.fernandez_huerta(test_data)
>>> textstat.szigriszt_pazos(test_data)
>>> textstat.gutierrez_polini(test_data)
>>> textstat.crawford(test_data)
```

Additional information on the formula they implement can be found in their respective docstrings.

## List of Functions

### Formulas

#### The Flesch Reading Ease formula

```python
textstat.flesch_reading_ease(text)
```

Returns the Flesch Reading Ease Score.

The following table can be helpful to assess the ease of
readability in a document.

The table is an _example_ of values. While the
maximum score is 121.22, there is no limit on how low
the score can be. A negative score is valid.

| Score |    Difficulty     |
|-------|-------------------|
|90-100 | Very Easy         |
| 80-89 | Easy              |
| 70-79 | Fairly Easy       |
| 60-69 | Standard          |
| 50-59 | Fairly Difficult  |
| 30-49 | Difficult         |
| 0-29  | Very Confusing    |

> Further reading on
[Wikipedia](https://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests#Flesch_reading_ease)

#### The Flesch-Kincaid Grade Level

```python
textstat.flesch_kincaid_grade(text)
```

Returns the Flesch-Kincaid Grade of the given text. This is a grade
formula in that a score of 9.3 means that a ninth grader would be able to
read the document.

> Further reading on
[Wikipedia](https://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests#Flesch%E2%80%93Kincaid_grade_level)

#### The Fog Scale (Gunning FOG Formula)

```python
textstat.gunning_fog(text)
```

Returns the FOG index of the given text. This is a grade formula in that
a score of 9.3 means that a ninth grader would be able to read the document.

> Further reading on
[Wikipedia](https://en.wikipedia.org/wiki/Gunning_fog_index)

#### The SMOG Index

```python
textstat.smog_index(text)
```

Returns the SMOG index of the given text. This is a grade formula in that
a score of 9.3 means that a ninth grader would be able to read the document.

Texts of fewer than 30 sentences are statistically invalid, because
the SMOG formula was normed on 30-sentence samples. textstat requires at
least 3 sentences for a result.

> Further reading on
[Wikipedia](https://en.wikipedia.org/wiki/SMOG)

#### Automated Readability Index

```python
textstat.automated_readability_index(text)
```

Returns the ARI (Automated Readability Index) which outputs
a number that approximates the grade level needed to
comprehend the text.

For example if the ARI is 6.5, then the grade level to comprehend
the text is 6th to 7th grade.

> Further reading on
[Wikipedia](https://en.wikipedia.org/wiki/Automated_readability_index)

#### The Coleman-Liau Index

```python
textstat.coleman_liau_index(text)
```

Returns the grade level of the text using the Coleman-Liau Formula. This is
a grade formula in that a score of 9.3 means that a ninth grader would be
able to read the document.

> Further reading on
[Wikipedia](https://en.wikipedia.org/wiki/Coleman%E2%80%93Liau_index)

#### Linsear Write Formula

```python
textstat.linsear_write_formula(text)
```

Returns the grade level using the Linsear Write Formula. This is
a grade formula in that a score of 9.3 means that a ninth grader would be
able to read the document.

> Further reading on
[Wikipedia](https://en.wikipedia.org/wiki/Linsear_Write)

#### Dale-Chall Readability Score

```python
textstat.dale_chall_readability_score(text)
```

Different from other tests, since it uses a lookup table
of the most commonly used 3000 English words. Thus it returns
the grade level using the New Dale-Chall Formula.

| Score       |  Understood by                                |
|-------------|-----------------------------------------------|
|4.9 or lower | average 4th-grade student or lower            |
|  5.0–5.9    | average 5th or 6th-grade student              |
|  6.0–6.9    | average 7th or 8th-grade student              |
|  7.0–7.9    | average 9th or 10th-grade student             |
|  8.0–8.9    | average 11th or 12th-grade student            |
|  9.0–9.9    | average 13th to 15th-grade (college) student  |

> Further reading on
[Wikipedia](https://en.wikipedia.org/wiki/Dale%E2%80%93Chall_readability_formula)

#### Readability Consensus based upon all the above tests

```python
textstat.text_standard(text, float_output=False)
```

Based upon all the above tests, returns the estimated school
grade level required to understand the text.

Optional `float_output` allows the score to be returned as a
`float`. Defaults to `False`.

#### Spache Readability Formula

```python
textstat.spache_readability(text)
```

Returns grade level of english text.

Intended for text written for children up to grade four.

> Further reading on
[Wikipedia](https://en.wikipedia.org/wiki/Spache_readability_formula)

#### McAlpine EFLAW Readability Score

```python
textstat.mcalpine_eflaw(text)
```

Returns a score for the readability of an english text for a foreign learner or
English, focusing on the number of miniwords and length of sentences.

It is recommended to aim for a score equal to or lower than 25. 

> Further reading on
[This blog post](https://strainindex.wordpress.com/2009/04/30/mcalpine-eflaw-readability-score/)

#### Reading Time

```python
textstat.reading_time(text, ms_per_char=14.69)
```

Returns the reading time of the given text.

Assumes 14.69ms per character.

> Further reading in
[This academic paper](https://homepages.inf.ed.ac.uk/keller/papers/cognition08a.pdf)

### Language Specific Formulas 
#### Índice de lecturabilidad Fernandez-Huerta (Spanish)  

```python
textstat.fernandez_huerta(text)
```

Reformulation of the Flesch Reading Ease Formula specifically for spanish.
The results can be interpreted similarly

> Further reading on
[This blog post](https://legible.es/blog/lecturabilidad-fernandez-huerta/)

#### Índice de perspicuidad de Szigriszt-Pazos (Spanish)  

```python
textstat.szigriszt_pazos(text)
```
Adaptation of Flesch Reading Ease formula for spanish-based texts.

Attempts to quantify how understandable a text is.

> Further reading on
[This blog post](https://legible.es/blog/perspicuidad-szigriszt-pazos/)

#### Fórmula de comprensibilidad de Gutiérrez de Polini (Spanish)  

```python
textstat.gutierrez_polini(text)
```

Returns the Guttiérrez de Polini understandability index.

Specifically designed for the texts in spanish, not an adaptation.
Conceived for grade-school level texts.

Scores for more complex text are not reliable.

> Further reading on
[This blog post](https://legible.es/blog/comprensibilidad-gutierrez-de-polini/)

#### Fórmula de Crawford (Spanish)  

```python
textstat.crawford(text)
```

Returns the Crawford score for the text.

Returns an estimate of the years of schooling required to understand the text.

The text is only valid for elementary school level texts.

> Further reading on
[This blog post](https://legible.es/blog/formula-de-crawford/)

#### Osman (Arabic)

```python
textstat.osman(text)
```

Returns OSMAN score for text.

Designed for Arabic, an adaption of Flesch and Fog Formula.
Introduces a new factor called "Faseeh".

> Further reading in
[This academic paper](https://www.aclweb.org/anthology/L16-1038.pdf)

#### Gulpease Index (Italian)

```python
textstat.gulpease_index(text)
```

Returns the Gulpease index of Italian text, which translates to 
level of education completed.

Lower scores require higher level of education to read with ease.

> Further reading on
[Wikipedia](https://it.wikipedia.org/wiki/Indice_Gulpease)

#### Wiener Sachtextformel (German)

```python
textstat.wiener_sachtextformel(text, variant)
```

Returns a grade level score for the given text.

A value of 4 means very easy text, whereas 15 means very difficult text.

> Further reading on
[Wikipedia](https://de.wikipedia.org/wiki/Lesbarkeitsindex#Wiener_Sachtextformel)

### Aggregates and Averages

#### Syllable Count

```python
textstat.syllable_count(text)
```

Returns the number of syllables present in the given text.

Uses the Python module [syllapy](https://github.com/mholtzscher/syllapy)
for syllable calculation.

#### Lexicon Count

```python
textstat.lexicon_count(text, removepunct=True)
```

Calculates the number of words present in the text.
Optional `removepunct` specifies whether we need to take
punctuation symbols into account while counting lexicons.
Default value is `True`, which removes the punctuation
before counting lexicon items.

#### Sentence Count

```python
textstat.sentence_count(text)
```

Returns the number of sentences present in the given text.

#### Character Count

```python
textstat.char_count(text, ignore_spaces=True)
```

Returns the number of characters present in the given text.

#### Letter Count

```python
textstat.letter_count(text, ignore_spaces=True)
```

Returns the number of characters present in the given text without punctuation.

#### Polysyllable Count

```python
textstat.polysyllabcount(text)
```

Returns the number of words with a syllable count greater than or equal to 3.

#### Monosyllable Count

```python
textstat.monosyllabcount(text)
```

Returns the number of words with a syllable count equal to one.

## Contributing

If you find any problems, you should open an
[issue](https://github.com/shivam5992/textstat/issues).

If you can fix an issue you've found, or another issue, you should open
a [pull request](https://github.com/shivam5992/textstat/pulls).

1. Fork this repository on GitHub to start making your changes to the master
branch (or branch off of it).
2. Write a test which shows that the bug was fixed or that the feature works as expected.
3. Send a pull request!

### Development setup

> It is recommended you use a [virtual environment](
https://docs.python.org/3/tutorial/venv.html), or [Pipenv](
https://docs.pipenv.org/) to keep your development work isolated from your
systems Python installation.

```bash
$ git clone https://github.com/<yourname>/textstat.git  # Clone the repo from your fork
$ cd textstat
$ pip install -r requirements.txt  # Install all dependencies

$ # Make changes

$ python -m pytest test.py  # Run tests
```


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/whylabs/whylabs-textstat",
    "name": "whylabs-textstat",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "Shivam Bansal, Chaitanya Aggarwal",
    "author_email": "shivam5992@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/d5/15/1058af47608109604d98453accaae60ebe7ad945e4d1bf556f6621043c44/whylabs_textstat-0.7.4.tar.gz",
    "platform": null,
    "description": "# Whylabs fork of textstat\n\nfor main repo see: https://github.com/textstat/textstat\n\nModifications from main repo:\n* replace the Pyphen dependency with syllapy.\n\n[![PyPI](https://img.shields.io/pypi/v/textstat.svg)](https://pypi.org/project/whylabs-textstat/)\n[![Downloads](https://img.shields.io/badge/dynamic/json.svg?url=https://pypistats.org/api/packages/whylabs-textstat/recent?mirrors=false&label=downloads&query=$.data.last_month&suffix=/month)](https://pypistats.org/packages/whylabs-textstat)\n\n**Textstat is an easy to use library to calculate statistics from text. It helps determine readability, complexity, and grade level.**\n\n<p align=\"center\">\n  <img width=\"100%\" src=\"https://images.unsplash.com/photo-1457369804613-52c61a468e7d?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&h=400&q=80\">\n</p>\n<p align=\"right\">\n  <sup>Photo by <a href=\"https://unsplash.com/@impatrickt\">Patrick Tomasso</a>\n  on <a href=\"https://unsplash.com/images/things/book\">Unsplash</a></sup>\n</p>\n\n## Usage\n\n```python\n>>> import textstat\n\n>>> test_data = (\n    \"Playing games has always been thought to be important to \"\n    \"the development of well-balanced and creative children; \"\n    \"however, what part, if any, they should play in the lives \"\n    \"of adults has never been researched that deeply. I believe \"\n    \"that playing games is every bit as important for adults \"\n    \"as for children. Not only is taking time out to play games \"\n    \"with our children and other adults valuable to building \"\n    \"interpersonal relationships but is also a wonderful way \"\n    \"to release built up tension.\"\n)\n\n>>> textstat.flesch_reading_ease(test_data)\n>>> textstat.flesch_kincaid_grade(test_data)\n>>> textstat.smog_index(test_data)\n>>> textstat.coleman_liau_index(test_data)\n>>> textstat.automated_readability_index(test_data)\n>>> textstat.dale_chall_readability_score(test_data)\n>>> textstat.difficult_words(test_data)\n>>> textstat.linsear_write_formula(test_data)\n>>> textstat.gunning_fog(test_data)\n>>> textstat.text_standard(test_data)\n>>> textstat.fernandez_huerta(test_data)\n>>> textstat.szigriszt_pazos(test_data)\n>>> textstat.gutierrez_polini(test_data)\n>>> textstat.crawford(test_data)\n>>> textstat.gulpease_index(test_data)\n>>> textstat.osman(test_data)\n```\n\nThe argument (text) for all the defined functions remains the same -\ni.e the text for which statistics need to be calculated.\n\n## Install\n\nYou can install textstat either via the Python Package Index (PyPI) or from source.\n\n### Install using pip\n\n```shell\npip install textstat\n```\n\n### Install using easy_install\n\n```shell\neasy_install textstat\n```\n\n### Install latest version from GitHub\n\n```shell\ngit clone https://github.com/textstat/textstat.git\ncd textstat\npip install .\n```\n\n### Install from PyPI\n\nDownload the latest version of textstat from http://pypi.python.org/pypi/textstat/\n\nYou can install it by doing the following:\n\n```shell\ntar xfz textstat-*.tar.gz\ncd textstat-*/\npython setup.py build\npython setup.py install # as root\n```\n\n## Language support\nBy default functions implement algorithms for english language. \nTo change language, use:\n\n```python\ntextstat.set_lang(lang)\n``` \n\nThe language will be used for syllable calculation and to choose \nvariant of the formula.\n\n### Language variants\nAll functions implement `en_US` language. Some of them has also variants \nfor other languages listed below. \n\n|  Function                   | en | de | es | fr | it | nl | pl | ru |\n|-----------------------------|----|----|----|----|----|----|----|----|\n| flesch_reading_ease         | \u2714  | \u2714  | \u2714  | \u2714  | \u2714  | \u2714  |    | \u2714  |\n| gunning_fog                 | \u2714  |    |    |    |    |    | \u2714  |    |\n\n#### Spanish-specific tests\nThe following functions are specifically designed for spanish language.\nThey can be used on non-spanish texts, even though that use case is not recommended.\n\n```python\n>>> textstat.fernandez_huerta(test_data)\n>>> textstat.szigriszt_pazos(test_data)\n>>> textstat.gutierrez_polini(test_data)\n>>> textstat.crawford(test_data)\n```\n\nAdditional information on the formula they implement can be found in their respective docstrings.\n\n## List of Functions\n\n### Formulas\n\n#### The Flesch Reading Ease formula\n\n```python\ntextstat.flesch_reading_ease(text)\n```\n\nReturns the Flesch Reading Ease Score.\n\nThe following table can be helpful to assess the ease of\nreadability in a document.\n\nThe table is an _example_ of values. While the\nmaximum score is 121.22, there is no limit on how low\nthe score can be. A negative score is valid.\n\n| Score |    Difficulty     |\n|-------|-------------------|\n|90-100 | Very Easy         |\n| 80-89 | Easy              |\n| 70-79 | Fairly Easy       |\n| 60-69 | Standard          |\n| 50-59 | Fairly Difficult  |\n| 30-49 | Difficult         |\n| 0-29  | Very Confusing    |\n\n> Further reading on\n[Wikipedia](https://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests#Flesch_reading_ease)\n\n#### The Flesch-Kincaid Grade Level\n\n```python\ntextstat.flesch_kincaid_grade(text)\n```\n\nReturns the Flesch-Kincaid Grade of the given text. This is a grade\nformula in that a score of 9.3 means that a ninth grader would be able to\nread the document.\n\n> Further reading on\n[Wikipedia](https://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests#Flesch%E2%80%93Kincaid_grade_level)\n\n#### The Fog Scale (Gunning FOG Formula)\n\n```python\ntextstat.gunning_fog(text)\n```\n\nReturns the FOG index of the given text. This is a grade formula in that\na score of 9.3 means that a ninth grader would be able to read the document.\n\n> Further reading on\n[Wikipedia](https://en.wikipedia.org/wiki/Gunning_fog_index)\n\n#### The SMOG Index\n\n```python\ntextstat.smog_index(text)\n```\n\nReturns the SMOG index of the given text. This is a grade formula in that\na score of 9.3 means that a ninth grader would be able to read the document.\n\nTexts of fewer than 30 sentences are statistically invalid, because\nthe SMOG formula was normed on 30-sentence samples. textstat requires at\nleast 3 sentences for a result.\n\n> Further reading on\n[Wikipedia](https://en.wikipedia.org/wiki/SMOG)\n\n#### Automated Readability Index\n\n```python\ntextstat.automated_readability_index(text)\n```\n\nReturns the ARI (Automated Readability Index) which outputs\na number that approximates the grade level needed to\ncomprehend the text.\n\nFor example if the ARI is 6.5, then the grade level to comprehend\nthe text is 6th to 7th grade.\n\n> Further reading on\n[Wikipedia](https://en.wikipedia.org/wiki/Automated_readability_index)\n\n#### The Coleman-Liau Index\n\n```python\ntextstat.coleman_liau_index(text)\n```\n\nReturns the grade level of the text using the Coleman-Liau Formula. This is\na grade formula in that a score of 9.3 means that a ninth grader would be\nable to read the document.\n\n> Further reading on\n[Wikipedia](https://en.wikipedia.org/wiki/Coleman%E2%80%93Liau_index)\n\n#### Linsear Write Formula\n\n```python\ntextstat.linsear_write_formula(text)\n```\n\nReturns the grade level using the Linsear Write Formula. This is\na grade formula in that a score of 9.3 means that a ninth grader would be\nable to read the document.\n\n> Further reading on\n[Wikipedia](https://en.wikipedia.org/wiki/Linsear_Write)\n\n#### Dale-Chall Readability Score\n\n```python\ntextstat.dale_chall_readability_score(text)\n```\n\nDifferent from other tests, since it uses a lookup table\nof the most commonly used 3000 English words. Thus it returns\nthe grade level using the New Dale-Chall Formula.\n\n| Score       |  Understood by                                |\n|-------------|-----------------------------------------------|\n|4.9 or lower | average 4th-grade student or lower            |\n|  5.0\u20135.9    | average 5th or 6th-grade student              |\n|  6.0\u20136.9    | average 7th or 8th-grade student              |\n|  7.0\u20137.9    | average 9th or 10th-grade student             |\n|  8.0\u20138.9    | average 11th or 12th-grade student            |\n|  9.0\u20139.9    | average 13th to 15th-grade (college) student  |\n\n> Further reading on\n[Wikipedia](https://en.wikipedia.org/wiki/Dale%E2%80%93Chall_readability_formula)\n\n#### Readability Consensus based upon all the above tests\n\n```python\ntextstat.text_standard(text, float_output=False)\n```\n\nBased upon all the above tests, returns the estimated school\ngrade level required to understand the text.\n\nOptional `float_output` allows the score to be returned as a\n`float`. Defaults to `False`.\n\n#### Spache Readability Formula\n\n```python\ntextstat.spache_readability(text)\n```\n\nReturns grade level of english text.\n\nIntended for text written for children up to grade four.\n\n> Further reading on\n[Wikipedia](https://en.wikipedia.org/wiki/Spache_readability_formula)\n\n#### McAlpine EFLAW Readability Score\n\n```python\ntextstat.mcalpine_eflaw(text)\n```\n\nReturns a score for the readability of an english text for a foreign learner or\nEnglish, focusing on the number of miniwords and length of sentences.\n\nIt is recommended to aim for a score equal to or lower than 25. \n\n> Further reading on\n[This blog post](https://strainindex.wordpress.com/2009/04/30/mcalpine-eflaw-readability-score/)\n\n#### Reading Time\n\n```python\ntextstat.reading_time(text, ms_per_char=14.69)\n```\n\nReturns the reading time of the given text.\n\nAssumes 14.69ms per character.\n\n> Further reading in\n[This academic paper](https://homepages.inf.ed.ac.uk/keller/papers/cognition08a.pdf)\n\n### Language Specific Formulas \n#### \u00cdndice de lecturabilidad Fernandez-Huerta (Spanish)  \n\n```python\ntextstat.fernandez_huerta(text)\n```\n\nReformulation of the Flesch Reading Ease Formula specifically for spanish.\nThe results can be interpreted similarly\n\n> Further reading on\n[This blog post](https://legible.es/blog/lecturabilidad-fernandez-huerta/)\n\n#### \u00cdndice de perspicuidad de Szigriszt-Pazos (Spanish)  \n\n```python\ntextstat.szigriszt_pazos(text)\n```\nAdaptation of Flesch Reading Ease formula for spanish-based texts.\n\nAttempts to quantify how understandable a text is.\n\n> Further reading on\n[This blog post](https://legible.es/blog/perspicuidad-szigriszt-pazos/)\n\n#### F\u00f3rmula de comprensibilidad de Guti\u00e9rrez de Polini (Spanish)  \n\n```python\ntextstat.gutierrez_polini(text)\n```\n\nReturns the Gutti\u00e9rrez de Polini understandability index.\n\nSpecifically designed for the texts in spanish, not an adaptation.\nConceived for grade-school level texts.\n\nScores for more complex text are not reliable.\n\n> Further reading on\n[This blog post](https://legible.es/blog/comprensibilidad-gutierrez-de-polini/)\n\n#### F\u00f3rmula de Crawford (Spanish)  \n\n```python\ntextstat.crawford(text)\n```\n\nReturns the Crawford score for the text.\n\nReturns an estimate of the years of schooling required to understand the text.\n\nThe text is only valid for elementary school level texts.\n\n> Further reading on\n[This blog post](https://legible.es/blog/formula-de-crawford/)\n\n#### Osman (Arabic)\n\n```python\ntextstat.osman(text)\n```\n\nReturns OSMAN score for text.\n\nDesigned for Arabic, an adaption of Flesch and Fog Formula.\nIntroduces a new factor called \"Faseeh\".\n\n> Further reading in\n[This academic paper](https://www.aclweb.org/anthology/L16-1038.pdf)\n\n#### Gulpease Index (Italian)\n\n```python\ntextstat.gulpease_index(text)\n```\n\nReturns the Gulpease index of Italian text, which translates to \nlevel of education completed.\n\nLower scores require higher level of education to read with ease.\n\n> Further reading on\n[Wikipedia](https://it.wikipedia.org/wiki/Indice_Gulpease)\n\n#### Wiener Sachtextformel (German)\n\n```python\ntextstat.wiener_sachtextformel(text, variant)\n```\n\nReturns a grade level score for the given text.\n\nA value of 4 means very easy text, whereas 15 means very difficult text.\n\n> Further reading on\n[Wikipedia](https://de.wikipedia.org/wiki/Lesbarkeitsindex#Wiener_Sachtextformel)\n\n### Aggregates and Averages\n\n#### Syllable Count\n\n```python\ntextstat.syllable_count(text)\n```\n\nReturns the number of syllables present in the given text.\n\nUses the Python module [syllapy](https://github.com/mholtzscher/syllapy)\nfor syllable calculation.\n\n#### Lexicon Count\n\n```python\ntextstat.lexicon_count(text, removepunct=True)\n```\n\nCalculates the number of words present in the text.\nOptional `removepunct` specifies whether we need to take\npunctuation symbols into account while counting lexicons.\nDefault value is `True`, which removes the punctuation\nbefore counting lexicon items.\n\n#### Sentence Count\n\n```python\ntextstat.sentence_count(text)\n```\n\nReturns the number of sentences present in the given text.\n\n#### Character Count\n\n```python\ntextstat.char_count(text, ignore_spaces=True)\n```\n\nReturns the number of characters present in the given text.\n\n#### Letter Count\n\n```python\ntextstat.letter_count(text, ignore_spaces=True)\n```\n\nReturns the number of characters present in the given text without punctuation.\n\n#### Polysyllable Count\n\n```python\ntextstat.polysyllabcount(text)\n```\n\nReturns the number of words with a syllable count greater than or equal to 3.\n\n#### Monosyllable Count\n\n```python\ntextstat.monosyllabcount(text)\n```\n\nReturns the number of words with a syllable count equal to one.\n\n## Contributing\n\nIf you find any problems, you should open an\n[issue](https://github.com/shivam5992/textstat/issues).\n\nIf you can fix an issue you've found, or another issue, you should open\na [pull request](https://github.com/shivam5992/textstat/pulls).\n\n1. Fork this repository on GitHub to start making your changes to the master\nbranch (or branch off of it).\n2. Write a test which shows that the bug was fixed or that the feature works as expected.\n3. Send a pull request!\n\n### Development setup\n\n> It is recommended you use a [virtual environment](\nhttps://docs.python.org/3/tutorial/venv.html), or [Pipenv](\nhttps://docs.pipenv.org/) to keep your development work isolated from your\nsystems Python installation.\n\n```bash\n$ git clone https://github.com/<yourname>/textstat.git  # Clone the repo from your fork\n$ cd textstat\n$ pip install -r requirements.txt  # Install all dependencies\n\n$ # Make changes\n\n$ python -m pytest test.py  # Run tests\n```\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Calculate statistical features from text",
    "version": "0.7.4",
    "project_urls": {
        "Homepage": "https://github.com/whylabs/whylabs-textstat"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5788c2967dbca356f1912a75104e4507f60521c80fd13e3d2e2385e2112fdec4",
                "md5": "122ad51a8adf6c4b327b9333f89d1dbd",
                "sha256": "e548a6de07c50b9177b1dac102f463b2a037695324074bdde500079bce449efc"
            },
            "downloads": -1,
            "filename": "whylabs_textstat-0.7.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "122ad51a8adf6c4b327b9333f89d1dbd",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 105246,
            "upload_time": "2024-07-11T19:52:33",
            "upload_time_iso_8601": "2024-07-11T19:52:33.439692Z",
            "url": "https://files.pythonhosted.org/packages/57/88/c2967dbca356f1912a75104e4507f60521c80fd13e3d2e2385e2112fdec4/whylabs_textstat-0.7.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d5151058af47608109604d98453accaae60ebe7ad945e4d1bf556f6621043c44",
                "md5": "3647ae9b2bb3165f4c38b8a12a057051",
                "sha256": "27c303c36f54535351b1313263d993eb118d325e745f9ef950d76cc518055cd0"
            },
            "downloads": -1,
            "filename": "whylabs_textstat-0.7.4.tar.gz",
            "has_sig": false,
            "md5_digest": "3647ae9b2bb3165f4c38b8a12a057051",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 110659,
            "upload_time": "2024-07-11T19:52:35",
            "upload_time_iso_8601": "2024-07-11T19:52:35.305081Z",
            "url": "https://files.pythonhosted.org/packages/d5/15/1058af47608109604d98453accaae60ebe7ad945e4d1bf556f6621043c44/whylabs_textstat-0.7.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-11 19:52:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "whylabs",
    "github_project": "whylabs-textstat",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "whylabs-textstat"
}
        
Elapsed time: 0.31214s