text_complexity_analyzer_cm.coh_metrix_indices.syntactic_complexity_indices
index
/home/hans/Proyectos/Python/TextComplexityAnalyzerCM/text_complexity_analyzer_cm/coh_metrix_indices/syntactic_complexity_indices.py

 
Modules
       
multiprocessing
spacy
statistics

 
Classes
       
builtins.object
SyntacticComplexityIndices

 
class SyntacticComplexityIndices(builtins.object)
    SyntacticComplexityIndices(nlp, language: str = 'es') -> None
 
This class will handle all operations to find the synthactic complexity 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 synthactic complexity 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_mean_number_of_modifiers_per_noun_phrase(self, text: str, workers: int = -1) -> float
This method calculates the mean number of modifiers per noun phrase in a text.
 
Parameters:
text(str): The text to be analized.
workers(int): Amount of threads that will complete this operation. If it's -1 then all cpu cores will be used.
 
Returns:
float: The mean of modifiers per noun phrases.
get_mean_number_of_words_before_main_verb(self, text: str, workers: int = -1) -> float
This method calculates the mean number of words before the main verb of sentences.
 
Parameters:
text(str): The text to be analized.
workers(int): Amount of threads that will complete this operation. If it's -1 then all cpu cores will be used.
 
Returns:
float: The mean of words before the main verb of sentences.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Functions
       
amount_of_words_before_main_verb(sentence: spacy.tokens.span.Span) -> int
This function counts the amount of words before the main verb of a sentence.
 
Parameters:
sentence(Span): The sentence to analyze, identified by a Spacy span.
 
Returns:
int: The amount of words before the main verb of a sentence.

 
Data
        ACCEPTED_LANGUAGES = {'es': 'es_core_news_lg'}
Tuple = typing.Tuple