Skip to content

Commit

Permalink
add language variable on FieldDefintion
Browse files Browse the repository at this point in the history
  • Loading branch information
BeritJanssen committed Nov 8, 2023
1 parent e5169de commit 5492847
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backend/addcorpus/corpus.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,7 @@ def __init__(self,
visualizations=[],
visualization_sort=None,
es_mapping={'type': 'text'},
language=None,
search_filter=None,
extractor=extract.Constant(None),
sortable=None,
Expand All @@ -735,6 +736,7 @@ def __init__(self,
self.visualizations = visualizations
self.visualization_sort = visualization_sort
self.es_mapping = es_mapping
self.language = language
self.indexed = indexed
self.hidden = not indexed or hidden
self.extractor = extractor
Expand Down
6 changes: 6 additions & 0 deletions backend/corpora/peaceportal/peaceportal.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,36 +154,42 @@ def request_media(self, document):
transcription_german = FieldDefinition(
name='transcription_de',
es_mapping=main_content_mapping(stopword_analysis=True, stemming_analysis=True, language='de'),
language='de',
hidden=True
)

transcription_english = FieldDefinition(
name='transcription_en',
es_mapping=main_content_mapping(stopword_analysis=True, stemming_analysis=True, language='en'),
language='en',
hidden=True
)

transcription_hebrew = FieldDefinition(
name='transcription_he', # no stopwords / stemmers available
es_mapping={'type': 'text'},
language='he',
hidden=True
)

transcription_latin = FieldDefinition(
name='transcription_la',
es_mapping={'type': 'text'}, # no stopwords / stemmers available
language='la',
hidden=True
)

transcription_greek = FieldDefinition(
name='transcription_el',
es_mapping=main_content_mapping(stopword_analysis=True, stemming_analysis=True, language='el'),
language='el',
hidden=True
)

transcription_dutch = FieldDefinition(
name='transcription_nl',
es_mapping=main_content_mapping(stopword_analysis=True, stemming_analysis=True, language='nl'),
language='nl',
hidden=True
)

Expand Down

0 comments on commit 5492847

Please sign in to comment.