lexnlp.extract.en.tests package¶
Submodules¶
lexnlp.extract.en.tests.test_acts module¶
lexnlp.extract.en.tests.test_amounts module¶
lexnlp.extract.en.tests.test_amounts_plain module¶
lexnlp.extract.en.tests.test_citations module¶
lexnlp.extract.en.tests.test_citations_plain module¶
lexnlp.extract.en.tests.test_conditions module¶
lexnlp.extract.en.tests.test_conditions_plain module¶
lexnlp.extract.en.tests.test_constraints module¶
lexnlp.extract.en.tests.test_constraints_plain module¶
lexnlp.extract.en.tests.test_copyright module¶
lexnlp.extract.en.tests.test_copyright_plain module¶
-
class
lexnlp.extract.en.tests.test_copyright_plain.
TestCopyrightPlain
(methodName='runTest')¶ Bases:
unittest.case.TestCase
-
test_big_file
()¶
-
test_copyrights
()¶
-
test_file_samples
()¶
-
test_text_coords
()¶
-
-
lexnlp.extract.en.tests.test_copyright_plain.
get_copyright_verbose_annotations
(text: str) → Generator[[lexnlp.extract.common.annotations.copyright_annotation.CopyrightAnnotation, None], None]¶
lexnlp.extract.en.tests.test_courts module¶
lexnlp.extract.en.tests.test_cusip module¶
-
class
lexnlp.extract.en.tests.test_cusip.
TestGetCUSIP
(methodName='runTest')¶ Bases:
lexnlp.extract.de.tests.test_amounts.AssertionMixin
-
test_correct_cases
()¶
-
test_file_samples
()¶
-
test_wrong_cases
()¶
-
lexnlp.extract.en.tests.test_dates module¶
lexnlp.extract.en.tests.test_dates_plain module¶
-
class
lexnlp.extract.en.tests.test_dates_plain.
TestDatesPlain
(methodName='runTest')¶ Bases:
unittest.case.TestCase
-
test_another_may
()¶
-
test_august
()¶
-
test_date_first_aug
()¶
-
test_dates
()¶
-
test_dates_times
()¶
-
test_file_samples
()¶
-
test_fp
()¶
-
test_moar_dates
()¶
-
test_more_more_dates
()¶
-
test_no_dates
()¶
-
test_one_date_this
()¶
-
test_section
()¶
-
test_should_be_fixed
()¶
-
test_two_dates_strict
()¶
-
test_two_ranges
()¶
-
lexnlp.extract.en.tests.test_definitions module¶
Definition unit tests for English.
This module implements unit tests for the definition extraction functionality in English.
- Todo:
- Better testing for exact test in return sources
- More pathological and difficult cases
-
class
lexnlp.extract.en.tests.test_definitions.
TestEnglishDefinitions
(methodName='runTest')¶ Bases:
unittest.case.TestCase
-
test_abbr_strip
()¶
-
test_annotations
()¶
-
test_apostrophe_in_definition
()¶
-
test_capitalized_false_positive
()¶
-
test_capitalized_with_trigger
()¶
-
test_capitalized_with_trigger_in_the_middle_of_sentense
()¶
-
test_def_called
()¶
-
test_definition_fixed
()¶
-
test_definition_ml
()¶
-
test_definition_quoted
()¶
-
test_definition_quoted_new_line
()¶
-
test_definitions_in_one_sentence
()¶
-
test_definitions_in_sentences_text
()¶
-
test_definitions_simple
()¶
-
test_dot_in_definition
()¶
-
test_emma
()¶
-
test_enquoted
()¶
-
test_fp_pronoun
()¶
-
test_fp_service_words
()¶
-
test_include_multitoken_definition
()¶ I think that the text (each an “Obligation” and collectively, the “Obligations”) IS the definition. But the parser skips the text because it has more than MAX_TERM_TOKENS (presently, 5) words.
So, the behavior is changed: now 10 words are allowed because there are 2 possible “definitions”.
-
test_merge_defs
()¶
-
test_merge_defs_consumed
()¶
-
test_misbrackets
()¶
-
test_newlines
()¶
-
test_noun_pattern_false_positive
()¶
-
test_obvious_embraced_definition
()¶
-
test_overlapping_defs
()¶
-
test_parenthesis
()¶
-
test_parse_in_extra_quotes
()¶
-
test_parse_moodys
()¶
-
test_process_ugly_braces_def
()¶
-
test_quotes_removed
()¶
-
test_reffered_to_def
()¶
-
test_reffered_to_def_excess_words
()¶
-
test_start_word_shall_be_false_positive
()¶
-
test_the
()¶
-
test_the_corporation_false_positive
()¶
-
test_too_long_definition
()¶
-
test_trigger_word_fullmatches
()¶
-
test_trim_defined_term
()¶
-
test_unbal_quotes
()¶
-
test_unpared_brackets
()¶
-
lexnlp.extract.en.tests.test_definitions_template module¶
-
class
lexnlp.extract.en.tests.test_definitions_template.
TestDefinitionsTemplate
(methodName='runTest')¶ Bases:
unittest.case.TestCase
-
test_file_samples
()¶
-
-
lexnlp.extract.en.tests.test_definitions_template.
get_definitions_sorted
(text: str)¶
lexnlp.extract.en.tests.test_dict_entities module¶
lexnlp.extract.en.tests.test_distance module¶
lexnlp.extract.en.tests.test_distances_plain module¶
lexnlp.extract.en.tests.test_durations module¶
lexnlp.extract.en.tests.test_durations_plain module¶
lexnlp.extract.en.tests.test_geoentities module¶
lexnlp.extract.en.tests.test_geoentities_plain module¶
-
class
lexnlp.extract.en.tests.test_geoentities_plain.
TestGeoentitiesPlain
(methodName='runTest')¶ Bases:
unittest.case.TestCase
-
test_file_samples
()¶
-
test_michigan_coords
()¶
-
test_multiline_address
()¶
-
test_several_entries
()¶
-
test_simple_address
()¶
-
-
lexnlp.extract.en.tests.test_geoentities_plain.
make_geoconfig
()¶
-
lexnlp.extract.en.tests.test_geoentities_plain.
parse_geo_annotations
(text: str) → List[lexnlp.extract.common.annotations.geo_annotation.GeoAnnotation]¶
lexnlp.extract.en.tests.test_introductory_words_detector module¶
lexnlp.extract.en.tests.test_money module¶
lexnlp.extract.en.tests.test_money_plain module¶
-
class
lexnlp.extract.en.tests.test_money_plain.
TestMoneyPlain
(methodName='runTest')¶ Bases:
unittest.case.TestCase
-
test_file_samples
()¶
-
test_money
()¶
-
-
lexnlp.extract.en.tests.test_money_plain.
get_money_annotations_sorted
(text)¶
lexnlp.extract.en.tests.test_parsing_speed module¶
-
class
lexnlp.extract.en.tests.test_parsing_speed.
TestParsingSpeed
(methodName='runTest')¶ Bases:
unittest.case.TestCase
This method is not named as test_XXX because it is not intended for (automatic) regression tests
-
check_time
(text: str, func: Callable, func_name: str, times: Dict[str, float]) → None¶
-
en_parsers_speed
()¶
-