lexnlp.extract.en.tests package

Submodules

lexnlp.extract.en.tests.test_acts module

class lexnlp.extract.en.tests.test_acts.TestGetActs(methodName='runTest')

Bases: lexnlp.extract.de.tests.test_amounts.AssertionMixin

test_ambiguous_cases()
test_correct_cases()
test_file_samples()
test_wrong_cases()

lexnlp.extract.en.tests.test_amounts module

lexnlp.extract.en.tests.test_amounts_plain module

class lexnlp.extract.en.tests.test_amounts_plain.TestAmountsPlain(methodName='runTest')

Bases: unittest.case.TestCase

test_amounts()
test_file_samples()
test_fraction_symbol()

lexnlp.extract.en.tests.test_citations module

lexnlp.extract.en.tests.test_citations_plain module

class lexnlp.extract.en.tests.test_citations_plain.TestCitationsPlain(methodName='runTest')

Bases: unittest.case.TestCase

test_citations()
test_file_samples()

lexnlp.extract.en.tests.test_conditions module

lexnlp.extract.en.tests.test_conditions_plain module

class lexnlp.extract.en.tests.test_conditions_plain.TestConditionsPlain(methodName='runTest')

Bases: unittest.case.TestCase

test_file_samples()

lexnlp.extract.en.tests.test_constraints module

lexnlp.extract.en.tests.test_constraints_plain module

class lexnlp.extract.en.tests.test_constraints_plain.TestConstraintsPlain(methodName='runTest')

Bases: unittest.case.TestCase

test_constraints()
test_file_samples()

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

class lexnlp.extract.en.tests.test_distances_plain.TestDistancesPlain(methodName='runTest')

Bases: unittest.case.TestCase

test_distances_digits()
test_distances_words()
test_file_samples()

lexnlp.extract.en.tests.test_durations module

lexnlp.extract.en.tests.test_durations_plain module

class lexnlp.extract.en.tests.test_durations_plain.TestDurationsPlain(methodName='runTest')

Bases: unittest.case.TestCase

test_a_and_b()
test_durations_days()
test_durations_digits()
test_file_samples()

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

class lexnlp.extract.en.tests.test_introductory_words_detector.TestIntroductoryWordsDetector(methodName='runTest')

Bases: unittest.case.TestCase

test_negative()
test_negative_combined()
test_positive()

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()

lexnlp.extract.en.tests.test_percent_plain module

class lexnlp.extract.en.tests.test_percent_plain.TestPercentPlain(methodName='runTest')

Bases: unittest.case.TestCase

test_file_samples()
test_percent()
test_percent_amount()
test_percent_fraction()
test_percent_mix_fraction()

lexnlp.extract.en.tests.test_percents module

lexnlp.extract.en.tests.test_phone_plain module

class lexnlp.extract.en.tests.test_phone_plain.TestPhonePlain(methodName='runTest')

Bases: unittest.case.TestCase

test_file_samples()
test_phone()

lexnlp.extract.en.tests.test_pii module

lexnlp.extract.en.tests.test_ratios module

lexnlp.extract.en.tests.test_ratios_plain module

class lexnlp.extract.en.tests.test_ratios_plain.TestRatiosPlain(methodName='runTest')

Bases: unittest.case.TestCase

test_file_samples()
test_ratio_slash()
test_ratios()

lexnlp.extract.en.tests.test_regulations module

lexnlp.extract.en.tests.test_regulations_plain module

class lexnlp.extract.en.tests.test_regulations_plain.TestRegulationsPlain(methodName='runTest')

Bases: unittest.case.TestCase

test_file_samples()
test_regulations()

lexnlp.extract.en.tests.test_span_tokenizer module

class lexnlp.extract.en.tests.test_span_tokenizer.TestSpanTokenizer(methodName='runTest')

Bases: unittest.case.TestCase

test_split_dont()
test_split_plain()
test_split_simplest_case()
test_split_with_quotes()

lexnlp.extract.en.tests.test_ssn_plain module

class lexnlp.extract.en.tests.test_ssn_plain.TestSsnPlain(methodName='runTest')

Bases: unittest.case.TestCase

test_file_samples()
test_ssn()

lexnlp.extract.en.tests.test_trademarks module

lexnlp.extract.en.tests.test_trademarks_plain module

class lexnlp.extract.en.tests.test_trademarks_plain.TestTrademarksPlain(methodName='runTest')

Bases: unittest.case.TestCase

test_annotation_coords()
test_file_samples()
test_trademarks()

lexnlp.extract.en.tests.test_urls module

lexnlp.extract.en.tests.test_urls_plain module

class lexnlp.extract.en.tests.test_urls_plain.TestRatiosPlain(methodName='runTest')

Bases: unittest.case.TestCase

test_file_samples()
test_ratios()

Module contents