Skip to content

Commit

Permalink
Kollokationssuche, einfach
Browse files Browse the repository at this point in the history
  • Loading branch information
dwerning authored Jul 7, 2023
2 parents 4b9a9db + d2d57f5 commit 25cdfa1
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src/main/java/tla/web/mvc/SearchController.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class SearchController {
private String defaultForm;

// public static final List<String> SEARCH_FORMS = List.of("lemma-quick", "lemma", "sentence");
public static final List<String> SEARCH_FORMS = List.of("lemma", /*"sentence", "text", "object",*/ "lemma-id", "sentence-id", "text-id", "object-id", "ths-id");
public static final List<String> SEARCH_FORMS = List.of("lemma", /*"sentence", "text", "object",*/ "collocation", "lemma-id", "sentence-id", "text-id", "object-id", "ths-id");

@ModelAttribute("allScripts")
public Script[] getAllScripts() {
Expand Down Expand Up @@ -85,6 +85,7 @@ public String mainSearchPage(
@ModelAttribute("lemma") Lemma lemma,
@ModelAttribute("lemmaSearchForm") LemmaSearch lemmaForm,
@ModelAttribute("sentenceSearchForm") SentenceSearch sentenceForm,
@ModelAttribute("collocationSearchForm") SentenceSearch collocationSearchForm,
//@ModelAttribute("textSearchForm") TextSearch textForm,
//@ModelAttribute("objectSearchForm") ObjectSearch objectForm,
@RequestParam MultiValueMap<String, String> params,
Expand Down
9 changes: 8 additions & 1 deletion src/main/resources/i18n/messages_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ error_500_long=Der Datenbank-Server konnte die Anfrage nicht korrekt bearbeiten.
msg_loading_sentences=Lade Sätze...
msg_loading_sentences_browser=Wir arbeiten daran, die Performance dieser Seite zu verbessern.
msg_more_metadata=Weitere Metadaten in einer zukünftigen Version der TLA-Web-Applikation.
msg_collocation_search=Eine <strong>Hieroglyphensuche</strong> und eine <strong>Kollokationssuche</strong> wird in einer zukünftigen Version der TLA-Web-Applikation hinzugefügt werden. Den Entwicklungsplan finden Sie <a href="/info/tla-development">hier</a>.
msg_hieroglyph_search=Eine <strong>Hieroglyphensuche</strong> wird in einer zukünftigen Version der TLA-Web-Applikation hinzugefügt werden. Den Entwicklungsplan finden Sie <a href="/info/tla-development">hier</a>.
msg_collocation_search=Eine Kollokationssuche <strong>mit definiertem Lemma-Abstand</strong> wird in einer zukünftigen Version der TLA-Web-Applikation hinzugefügt werden. Den Entwicklungsplan finden Sie <a href="/info/tla-development">hier</a>.
msg_occurences_sorting=Möglichkeiten die Ergebnisliste zu <strong>sortieren</strong> werden in einer zukünftigen Version der TLA-Web-Applikation hinzugefügt werden.
msg_sentences_page=Eine Seite mit der <strong>Sequenz von Sätzen</strong> des Textes wird aktuell für eine nächste Version der TLA-Web-Applikation programmiert. Den Entwicklungsplan finden Sie <a href="/info/tla-development">hier</a>.
msg_sentence_comments=In einer zukünftigen Version der TLA-Webanwendung werden auch die <strong>Kommentare</strong> der Autor:innen zu Sätzen oder Satzteilen angezeigt werden. Den Entwicklungsplan finden Sie <a href="/info/tla-development">hier</a>.
Expand Down Expand Up @@ -380,6 +381,7 @@ form_label_text-id-search=Text-ID nachschlagen
form_label_object-id-search=Objekt-ID nachschlagen
form_label_ths-id-search=Thesaurus-ID nachschlagen
form_label_lemma-search=Lemma suchen
form_label_collocation-search=Lemmata-Kollokation suchen
form_label_sentence-search=Sätze suchen
form_label_text-search=Texte suchen

Expand All @@ -405,6 +407,9 @@ field_label_lemma=Lemma
field_label_hieroglyphs=Hieroglyphen
field_label_sort_order=Sortieren nach

field_label_collocation_lemma_1=Lemma Nr. 1
field_label_collocation_lemma_2=Lemma Nr. 2

field_value_label_wordClass_type_excl_names=(alle außer Personen-/Königsnamen)
field_value_label_wordClass_type_excl_namestitlesepithets=(alle außer Namen/Titel/Epitheta)
field_value_label_wordClass_type_adjective=Adjektive
Expand Down Expand Up @@ -487,6 +492,7 @@ button_label_text-id_search=ID nachschlagen
button_label_object-id_search=ID nachschlagen
button_label_ths-id_search=ID nachschlagen
button_label_lemma_search=Lemma suchen
button_label_collocation_search=Kollokation suchen
button_label_sentence_search=Belegstellensuche
button_label_modify_search=Suche modifizieren
button_label_hide_property_lemma-id=Lemma-ID
Expand Down Expand Up @@ -526,6 +532,7 @@ button_copy_sentenceID=Satz ID kopieren

result_page_title_lemma=Lemma-Suchergebnisse
result_page_title_sentence=Belegstellen-Suchergebnisse
result_page_title_collocation=Kollokationssuche-Ergebnis
result_page_description_query=Such-Parameter
result_page_description_left=Suchergebnis
result_page_description_middle=von
Expand Down
9 changes: 8 additions & 1 deletion src/main/resources/i18n/messages_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ error_500_long=The database server failed to process your request.
msg_loading_sentences=Loading sentences...
msg_loading_sentences_browser=We are struggling to improve the performance of this page.
msg_more_metadata=More metadata in a future version of the TLA web app.
msg_collocation_search=<strong>Hieroglyph search</strong> and <strong>collocation search</strong> yet to be implemented for a future version of the TLA web app. For the development plan, see <a href="/info/tla-development">here</a>.
msg_hieroglyph_search=<strong>Hieroglyph search</strong> yet to be implemented for a future version of the TLA web app. For the development plan, see <a href="/info/tla-development">here</a>.
msg_collocation_search=A collocation search <strong>with defined lemma distance</strong> yet to be implemented for a future version of the TLA web app. For the development plan, see <a href="/info/tla-development">here</a>.
msg_occurences_sorting=Possibilities to <strong>sort</strong> the results list will be added in a future version of the TLA web application.
msg_sentences_page=A page that displays the <strong>sequence of sentences</strong> of the text is currently being implemented for a future release of the TLA web app. For the development plan, see <a href="/info/tla-development">here</a>.
msg_sentence_comments=A future release of the TLA web app will also display possible <strong>authors’ comments</strong> to sentences or parts of sentences. For the development plan, see <a href="/info/tla-development">here</a>.
Expand Down Expand Up @@ -379,6 +380,7 @@ form_label_text-id-search=Look up text ID
form_label_object-id-search=Look up object ID
form_label_ths-id-search=Look up thesaurus ID
form_label_lemma-search=Search for lemma
form_label_collocation-search=Search for lemma collocation
form_label_sentence-search=Search for sentences
form_label_text-search=Search for texts

Expand All @@ -404,6 +406,9 @@ field_label_lemma=Lemma
field_label_hieroglyphs=Hieroglyphs
field_label_sort_order=Sort by

field_label_collocation_lemma_1=Lemma no. 1
field_label_collocation_lemma_2=Lemma no. 2

field_value_label_wordClass_type_excl_names=(Any but personal/royal names)
field_value_label_wordClass_type_excl_namestitlesepithets=(Any but names/titles/epithets)
field_value_label_wordClass_type_adjective=Adjectives
Expand Down Expand Up @@ -486,6 +491,7 @@ button_label_text-id_search=Look up ID
button_label_object-id_search=Look up ID
button_label_ths-id_search=Look up ID
button_label_lemma_search=Search for lemma
button_label_collocation_search=Search for collocation
button_label_sentence_search=Search text corpus
button_label_modify_search=Modify Search
button_label_hide_property_lemma-id=Lemma ID
Expand Down Expand Up @@ -525,6 +531,7 @@ button_copy_sentenceID=Copy sentence ID

result_page_title_lemma=Lemma Search Results
result_page_title_sentence=Attestation Search Results
result_page_title_collocation=Collocation Search Results
result_page_description_query=Search parameter
result_page_description_left=Search results
result_page_description_middle=of
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/pages/de/help/search-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ <h3 th:text="#{field_label_bibliography}">Bibliographie</h3>
<p>Aktuell ist hier leider noch keine Phrasensuche möglich. Mehrere durch Leerzeichen getrennte Wörter werden im Sinne von „(irgendwo) A <code>und</code> (irgendwo) B‟ interpretiert.</p>
</div>

<div class="ml-sm-4"><th:block th:replace="fragments/common :: construction(#{msg_collocation_search})"></th:block></div>
<div class="ml-sm-4"><th:block th:replace="fragments/common :: construction(#{msg_hieroglyph_search})"></th:block></div>
</section>
<section>
<h2> Formulare „<span th:text="#{form_label_some-id-search}">ID nachschlagen</span></h2>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/pages/en/help/search-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ <h3 th:text="#{field_label_bibliography}">Bibliography</h3>

</div>

<div class="ml-sm-4"><th:block th:replace="fragments/common :: construction(#{msg_collocation_search})"></th:block></div>
<div class="ml-sm-4"><th:block th:replace="fragments/common :: construction(#{msg_hieroglyph_search})"></th:block></div>
</section>
<section>
<h2><span th:text="#{form_label_some-id-search}">Look up ID</span>” forms</h2>
Expand Down
30 changes: 28 additions & 2 deletions src/main/resources/templates/fragments/search/forms.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,34 @@
</div>
</form>

<!-- lemma/dictionary search form -->

<!-- collocation search form -->
<form id="collocation-search" name="collocation-search"
th:action="@{${@searchController.getSearchResultsPageRoute(@__sentenceController__)}}"
th:object="${sentenceSearchForm}" method="get">

<div class="form-group row">
<label class="col-form-label col-xl-3" for="collocation_lemma_1">
<span th:text="#{field_label_collocation_lemma_1}">Lemma ID 1</span>
</label>
<div class="col-xl-9">
<input class="form-control" type="text" th:field="*{tokens[0].lemma.id}" id="collocation_lemma_1"/>
</div>
</div>
<div class="form-group row">
<label class="col-form-label col-xl-3" for="collocation_lemma_2">
<span th:text="#{field_label_collocation_lemma_2}">Lemma ID 2</span>
</label>
<div class="col-xl-9">
<input class="form-control" type="text" th:field="*{tokens[1].lemma.id}" id="collocation_lemma_2"/>
</div>
</div>

<div class="ml-2 mb-sm-3"><th:block th:replace="fragments/common :: construction(#{msg_collocation_search})"></th:block></div>
</form>


<!-- lemma/dictionary search form -->
<form id="lemma-search" name="lemma-search"
th:action="@{${@searchController.getSearchResultsPageRoute(@__lemmaController__)}}"
th:object="${lemmaSearchForm}" method="get">
Expand Down Expand Up @@ -211,7 +237,7 @@
</div>
</div>

<div class="ml-2 mb-sm-3"><th:block th:replace="fragments/common :: construction(#{msg_collocation_search})"></th:block></div>
<div class="ml-2 mb-sm-3"><th:block th:replace="fragments/common :: construction(#{msg_hieroglyph_search})"></th:block></div>


<!-- <div th:replace=" :: type-spec('annotation-type', 'lemmaSearchForm.anno', ${lemmaAnnotationTypes})"/>-->
Expand Down
7 changes: 4 additions & 3 deletions src/main/resources/templates/sentence/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<body>

<div layout:fragment="content" th:with="lemmaID=${#request.getParameter('tokens[0].lemma.id')}">
<div layout:fragment="content" th:with="lemmaID=${#request.getParameter('tokens[0].lemma.id')},lemmaID2=${#request.getParameter('tokens[1].lemma.id')}">

<!-- loading animation -->
<!--<div class="loader-wrapper">
Expand All @@ -29,13 +29,14 @@
<!-- result page heading -->
<div class="search-header row mb-sm-3 d-flex justify-content-between">
<div class="result">
<h2 class="id mt-sm-1" th:text="#{result_page_title_sentence}">Sentence Search Results</h2>
<h2 class="id mt-sm-1" th:text="${lemmaID2} != null AND ${lemmaID2} != ''?#{result_page_title_collocation}:#{result_page_title_sentence}">Attestation Search Results</h2>
</div>
<div th:replace="fragments/common :: social('sentence-search-results')"/>
</div>

<div class="row ml-sm-2"><strong th:text="#{result_page_description_query}">Search parameter</strong>:
<div class="row ml-sm-2"><strong th:text="#{result_page_description_query}">Search parameter</strong>:&nbsp;
<span id="queryLemmaIDHeader" th:text="#{field_label_lemma_id}"></span> = <span id="queryLemmaID" th:text="${lemmaID}"> </span>
<span th:if="${lemmaID2} != null AND ${lemmaID2} != ''" id="queryLemmaID2Header" th:text="', '+#{field_label_lemma_id}+' 2'"></span> = <span id="queryLemmaID2" th:text="${lemmaID2}"> </span>
</div>

<div class="row ml-sm-2" th:if="${searchResults.size} > 0">
Expand Down

0 comments on commit 25cdfa1

Please sign in to comment.