analysis/analysis_thread.c [ Modules ]
SEE ALSO
For a description of public interface functions, module synopsis and its purpose see analysis/analysis_thread.
analysis_thread/atree_list_try_cell [ Functions ]
[ Top ] [ analysis_thread ] [ Functions ]
NAME
atree_list_try_cell -- dispatch according to the cell_type and call the right function
SYNOPSIS
458 atree_list_try_cell(ms, cell_type, pei);
FUNCTION
The function calls the right function to handle the list cell in respect of its type. The type is given by the cell_type parameter. The cell is an item of the list found in the trie.
INPUTS
- ms - the analysis structure
- cell_type - a type of the cell
- pei - a union describing the scheme or form
RESULT
void, but accumulated in ms->lresults
analysis_thread/atree_try_der_cell [ Functions ]
[ Top ] [ analysis_thread ] [ Functions ]
NAME
atree_try_der_cell -- goes through the hash list and adds all the results
SYNOPSIS
398 atree_try_der_cell(ms, maw);
INPUTS
- ms - the analysis structure
- maw - the pattern structure
RESULT
void, but accumulated in ms->lresults
analysis_thread/find_lr [ Functions ]
[ Top ] [ analysis_thread ] [ Functions ]
NAME
find_lr -- find a lemma result
SYNOPSIS
78 struct TRLemma *lr = find_lr(ms, lm_idx, attr_atom);
FUNCTION
The function finds a record in the ms->lresults stack using the ms->lht map. The record is specified by the lm_idx index parameter and attr_atom.
If the record is found, the lm_idx key string is removed from the ms->char_stack. Otherwise the record is created, registered into the hash table and initialized. The tag_list field is initialized with an empty list.
The string key is found in the hash table but the records differs in the attr_atom field, the former key storage is reused and new one is wipped out from the ms->char_stack.
INPUTS
- ms - the analysis structure
- lm_idx - index of the beginning of the last inserted lemma into the ms->char_stack
- attr_atom - just a natural value (attribute atom).
RESULT
- lr - a pointer to the lemma result structure. The pointer shouldn't be hold over insert operations on the ms->lresults.
analysis_thread/form_constr_lemma [ Functions ]
[ Top ] [ analysis_thread ] [ Functions ]
NAME
form_constr_lemma -- creates the resulting lemma string from the form record
SYNOPSIS
422 natural idx = form_constr_lemma(ms, f);
FUNCTION
The function concatenates several strings to get the resulting lemma. It uses ms->lemma_p to start with the prefix and continues with a part of the ms->form_str derived with the f->cut_idx string instruction.
INPUTS
- ms - the analysis structure
- f - a form description structure
RESULT
The index idx to the ms->char_stack is returned.
SEE ALSO
analysis_thread/hash_der_cell_constr_lemma [ Functions ]
[ Top ] [ analysis_thread ] [ Functions ]
NAME
hash_der_cell_constr_lemma -- creates the resulting lemma string from the pattern record
SYNOPSIS
350 natural idx = hash_der_cell_constr_lemma(ms, maw, fc);
FUNCTION
The function concatenates several strings to get the resulting lemma. It uses ms->lemma_p to start with the prefix and continues with kofix derived from ms->form_str possibly with the modification by the maw->rt2lmm_idx string instruction. Then it is finished by the fc.cut_idx string instruction.
INPUTS
- ms - the analysis structure
- maw - the pattern structure
- fc - the tag group and cut_idx from the compound scheme from the scheme hash table
RESULT
The index idx to the ms->char_stack is returned.
SEE ALSO
analysis_thread/merge_tags [ Functions ]
[ Top ] [ analysis_thread ] [ Functions ]
NAME
merge_tags -- merges the tg_idx tags to the lemma result; all megre_tags_XX functions are documented here
SYNOPSIS
198 ms->merge_tags(ms, lr, tg_idx);
FUNCTION
The function filters valid tags from the list and adds them to the lr->tag_list.
The tag validity definition changes with the particilar function.
The function merge_tags_ng considers the tag to be valid if:
- if admits negation by the negation joker or if the negation is required and the tag is affirmative and a noun or an adjective or a verb or if the negation is not required
- and (conjunction) it admits grading by the grading joker or if the grading is required and the tag is comparative and an adjective or an adverb or the grading is not required.
The function merge_tags_prefix accepts tags that are not abbreviations and are compatible with the recognized prefix, i.e. if it is a noun or an adjective with the nominal prefix type or a verb with the verb prefix type.
The function merge_tags_prefix_ng combines the restriction on prefix and negation and grading.
The functions merge_tags_simple, merge_tags_fallback and merge_tags_number accept all tags. They only differs in source attribute.
INPUTS
- ms - the analysis structure
- lr - the lemma result structure to which the tags should be added
- tg_idx - the index to the ms->ma->int_rep; it specifies the tags to be added; the list end is marked by NATURAL_MAX
RESULT
void
analysis_thread/morfo_analysis_trace_list [ Functions ]
[ Top ] [ analysis_thread ] [ Functions ]
NAME
morfo_analysis_trace_list -- goes through the list of description structures found in the trie
SYNOPSIS
490 morfo_analysis_trace_list(ms, list_addr);
FUNCTION
The function iterates through the list found in a node of the trie.
INPUTS
- ms - the analysis structure
- list_addr - an address of the head of the list; the list is stored in the ms->ma->pei_rep repository
RESULT
void, but accumulated in ms->lresults
analysis_thread/morfo_analysis_trace_tree [ Functions ]
[ Top ] [ analysis_thread ] [ Functions ]
NAME
morfo_analysis_trace_tree -- goes through the trie searching the word form
SYNOPSIS
515 morfo_analysis_trace_tree(ms);
FUNCTION
The recursive function to descend into the trie. It is driven by the ms->form_end string.
INPUTS
- ms - the analysis structure
- ms->form_str - the beginning of the form that will be used to create the lemma
- ms->form_end - the next letter that will be analyzed
- ms->lemma_p - the total beginning of the form including a prefix (not ne/nej)
- ms->lemma_p_len - the prefix length (not ne/nej)
- ms->neg - indicates presence of the ne- prefix; used by some merge_tags methods
- ms->grade - indicates presence of the nej- prefix; used by some merge_tags methods
- ms->merge_tags - a method to merge (actually filter) the found tags
RESULT
void, but accumulated in ms->lresults
analysis_thread/new_result [ Functions ]
[ Top ] [ analysis_thread ] [ Functions ]
NAME
new_result -- merges the new result into that what have already been found
SYNOPSIS
315 new_result(ms, lm_idx, tg_idx, attr_atom);
FUNCTION
Merges the new result with the results for the lemma with those that have already been found.
No result may be added if all the tags are filtered out.
INPUTS
- ms - the analysis structure
- lm_idx - the index to the ms->char_stack to the beginning of the lemma
- tg_idx - the index to the ms->ma->int_rep; it specifies the tags to be added; the list end is marked by NATURAL_MAX
- attr_atom - the attribute atom to associate with the result
RESULT
void
SEE ALSO
analysis_thread/new_t_result [ Functions ]
[ Top ] [ analysis_thread ] [ Functions ]
NAME
new_t_result -- prepends an atom to the lr->tag_list
SYNOPSIS
143 lr->tag_list = new_t_result(ms, 8 * atom, lr->tag_list, rtsNumber);
FUNCTION
The function behaves like a list prepend. It works on a ms->tresults stack and initializes the inserted structure.
INPUTS
- ms - the analysis structure
- atom - an atom number; it is supposed to encode the tag-atom, neg and grade on the least significant bits
- next - an index of the next list item
- src - the source attribute of the tag
RESULT
- tag_list - returns an index of the new head of the list
analysis_thread/run_a_ng [ Functions ]
[ Top ] [ analysis_thread ] [ Functions ]
NAME
run_a_ng -- run the analysis on the given string; consider ne-/nej-
SYNOPSIS
599 run_a_ng(ms, form_str);
FUNCTION
The function prepares the execution of the analysis if it recognizes ne-, nej-, and nejne- prefixes. The prefixes are not the subject of the analysis. However they are indicated by ms->neg and ms->grade fields.
It fills in the needed fields of the ms structure and runs the analysis of the form with the recognized prefixes removed. Only the tags that goes with the prefixes are accepted.
INPUTS
- ms - the analysis structure
- form_str - the string to analyze
RESULT
void, but accumulated in ms->lresults
WARNING No analysis is executed if no prefix is recognized.
analysis_thread/run_a_prefix [ Functions ]
[ Top ] [ analysis_thread ] [ Functions ]
NAME
run_a_prefix -- run the analysis on the given string; consider listed prefixes
SYNOPSIS
667 run_a_prefix(ms, form_str);
FUNCTION
The function prepares the execution of the analysis. It fills in the needed fields of the ms structure and runs the recognition of the listed prefixes followed by the form analysis.
Only the tags that goes with the recognized prefixe are accepted.
INPUTS
- ms - the analysis structure
- form_str - the string to analyze
RESULT
void, but accumulated in ms->lresults
WARNING No analysis is executed if no prefix is recognized.
analysis_thread/run_a_prefix_ng [ Functions ]
[ Top ] [ analysis_thread ] [ Functions ]
NAME
run_a_prefix_ng -- run the analysis on the given string; consider ne-/nej- and other prefixes
SYNOPSIS
711 run_a_prefix_ng(ms, form_str);
FUNCTION
The function prepares the execution of the analysis if it recognizes ne-, nej-, and nejne- prefixes. The prefixes ne- and nej- are not the subject of the analysis. However they are indicated by ms->neg and ms->grade fields.
It fills in the needed fields of the ms structure and runs the analysis of the form with the recognized prefixes ne- and nej- removed. Then the recognition of other prefixes starts.
Only the tags that goes with the prefixes are accepted.
INPUTS
- ms - the analysis structure
- form_str - the string to analyze
RESULT
void, but accumulated in ms->lresults
WARNING No analysis is executed if no prefix is recognized.
analysis_thread/run_a_simple [ Functions ]
[ Top ] [ analysis_thread ] [ Functions ]
NAME
run_a_simple -- run the analysis on the given string
SYNOPSIS
564 run_a_simple(ms, form_str);
FUNCTION
The function prepares the execution of the analysis. It fills in the needed fields of the ms structure and runs the analysis. All the tags are accepted.
INPUTS
- ms - the analysis structure
- form_str - the string to analyze
RESULT
void, but accumulated in ms->lresults