| | |
- builtins.object
-
- DescriptiveIndices
class DescriptiveIndices(builtins.object) |
| |
DescriptiveIndices(nlp, language: str = 'es') -> None
This class will handle all operations to obtain the descriptive indices of a text according to Coh-Metrix |
| |
Methods defined here:
- __init__(self, nlp, language: str = 'es') -> None
- The constructor will initialize this object that calculates the descriptive indices for a specific language of those that are available.
Parameters:
nlp: The spacy model that corresponds to a language.
language(str): The language that the texts to process will have.
Returns:
None.
- get_length_of_paragraphs(self, text: str, workers: int = -1) -> text_complexity_analyzer_cm.utils.statistics_results.StatisticsResults
- This method returns the average amount and standard deviation of sentences in each paragraph.
text(str): The text to be anaylized.
workers(int): Amount of threads that will complete this operation. If it's -1 then all cpu cores will be used.
Returns:
StatisticsResults: The mean and standard deviation of the amount in sentences in each paragraph.
- get_length_of_sentences(self, text: str, workers: int = -1) -> text_complexity_analyzer_cm.utils.statistics_results.StatisticsResults
- This method returns the average amount and standard deviation of words in each sentence.
Parameters:
text(str): The text to be anaylized.
language(str): The language of the text to be analyzed.
workers(int): Amount of threads that will complete this operation. If it's -1 then all cpu cores will be used.
Returns:
StatisticsResults: The mean and standard deviation of the amount in words in each sentence.
- get_length_of_words(self, text: str, workers: int = -1) -> text_complexity_analyzer_cm.utils.statistics_results.StatisticsResults
- This method returns the average amount and standard deviation of letters in each word.
Parameters:
text(str): The text to be anaylized.
workers(int): Amount of threads that will complete this operation. If it's -1 then all cpu cores will be used.
Returns:
StatisticsResults: The mean and standard deviation of the amount in letters in each word.
- get_paragraph_count_from_text(self, text: str) -> int
- This method counts how many paragarphs are there in a text
Parameters:
text(str): The text to be analyzed
Returns:
int: The amount of paragraphs in a text
- get_sentence_count_from_text(self, text: str, workers: int = -1) -> int
- This method counts how many sentences a text has.
Parameters:
text(str): The text to be analyzed.
workers(int): Amount of threads that will complete this operation. If it's -1 then all cpu cores will be used.
Returns:
int: The amount of sentences.
- get_syllables_per_word(self, text: str, workers=-1) -> text_complexity_analyzer_cm.utils.statistics_results.StatisticsResults
- This method returns the average amount and standard deviation of syllables in each word.
Parameters:
text(str): The text to be anaylized.
workers(int): Amount of threads that will complete this operation. If it's -1 then all cpu cores will be used.
Returns:
StatisticsResults: The mean and standard deviation of the amount in syllables in each word.
- get_word_count_from_text(self, text: str, workers: int = -1) -> int
- This method counts how many words a text has.
Parameters:
text(str): The text to be anaylized.
workers(int): Amount of threads that will complete this operation. If it's -1 then all cpu cores will be used.
Returns:
int: The amount of words.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
| |