Skip to content

Commit

Permalink
update test data, correct era -> chamber
Browse files Browse the repository at this point in the history
  • Loading branch information
BeritJanssen committed Sep 27, 2023
1 parent 58a2c22 commit fbd202e
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
2 changes: 2 additions & 0 deletions backend/corpora/parliament/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def parliament_corpora_settings(settings):
'parliament-denmark': os.path.join(here, 'denmark.py'),
'parliament-denmark-new': os.path.join(here, 'denmark-new.py'),
'parliament-finland': os.path.join(here, 'finland.py'),
'parliament-finland-old': os.path.join(here, 'finland-old.py'),
'parliament-norway': os.path.join(here, 'norway.py'),
'parliament-norway-new': os.path.join(here, 'norway-new.py'),
'parliament-ireland': os.path.join(here, 'ireland.py')
Expand All @@ -34,6 +35,7 @@ def parliament_corpora_settings(settings):
settings.PP_SWEDEN_DATA = os.path.join(here, 'tests', 'data', 'sweden')
settings.PP_SWEDEN_OLD_DATA = os.path.join(here, 'tests', 'data', 'sweden-old')
settings.PP_FINLAND_DATA = os.path.join(here, 'tests', 'data', 'finland')
settings.PP_FINLAND_OLD_DATA = os.path.join(here, 'tests', 'data', 'finland-old')
settings.PP_NORWAY_DATA = os.path.join(here, 'tests', 'data', 'norway')
settings.PP_NORWAY_NEW_DATA = os.path.join(here, 'tests', 'data', 'norway-new')
settings.PP_DENMARK_DATA = os.path.join(here, 'tests', 'data', 'denmark')
Expand Down
7 changes: 4 additions & 3 deletions backend/corpora/parliament/finland-old.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ def sources(self, start, end):

document_context = document_context()

chamber = field_defaults.chamber()
chamber.extractor = CSV(field='estate')

country = field_defaults.country()
country.extractor = Constant('Finland')

Expand All @@ -48,9 +51,6 @@ def sources(self, start, end):
date_latest.search_filter.lower = min_date
date_latest.search_filter.upper = max_date

era = field_defaults.era(include_aggregations=True)
era.extractor = CSV(field='estate')

language = field_defaults.language()
language.extractor = CSV(field='language')

Expand All @@ -76,6 +76,7 @@ def sources(self, start, end):

def __init__(self):
self.fields = [
self.chamber,
self.country,
self.date_earliest,
self.date_latest,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 17 additions & 3 deletions backend/corpora/parliament/tests/test_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,13 +481,27 @@
'docs': [
{
'country': 'Finland',
'speech': 'FÖUDT HOS FINLANDS RIDDERSKAP OCR ADEL VID LANDTDAGEN ÅR 1877.TREDJE HÄFTET. Från den 1 till den 31 Oktober. FINSKA LITTERATUR-SÄLLBKAPETS TRYCKERl, 1878.',
'speech': """FÖUDT HOS
FINLANDS RIDDERSKAP OCR ADEL
VID
LANDTDAGEN ÅR 1877.
TREDJE HÄFTET.
Från den 1 till den 31 Oktober.
FINSKA LITTERATUR-SÄLLBKAPETS TRYCKERl,
1878.""",
'id': 'Adeln_Prot_1877_III.pdf_3_0',
'chamber': 'nobility',
'date_earliest': '1877-01-01',
'date_latest': '1877-12-31',
'page': 0,
'page': '0',
'language': 'swe',
'era': 'nobility',
'source_archive': 'Adeln_Prot_1877_III.pdf'
},
],
Expand Down

0 comments on commit fbd202e

Please sign in to comment.