diff --git a/css/coptic_dictionary.css b/css/coptic_dictionary.css index 5540081..9c520f9 100644 --- a/css/coptic_dictionary.css +++ b/css/coptic_dictionary.css @@ -26,7 +26,7 @@ body{ } .anti{font-family: antinoouRegular, sans-serif;} -#orths td{font-family: antinoouRegular, sans-serif;} +#orths td{font-family: antinoouRegular, sans-serif; vertical-align: top;} #results td{font-family: antinoouRegular, sans-serif;} #senses td{font-family: antinoouRegular, sans-serif;} .entrylist td{font-family: antinoouRegular, sans-serif;} @@ -102,7 +102,7 @@ ol{margin: 0px !important} .icon-annis:before { content: "\e608"; font-family: 'annistools'; - color: #6d2020; + color: #AE2124; } @@ -141,9 +141,9 @@ ol{margin: 0px !important} border: 1px solid gray; } -.freq_icon{color: #6d2020; +.freq_icon{color: #AE2124; position: relative; -top: -3px; +top: 6px; } @@ -323,6 +323,8 @@ padding:2px } .annis_link { + vertical-align:top; + text-align:right; color:#9e6a43; } @@ -331,4 +333,75 @@ padding:2px } .orth_table_header > th{font-family: antinoouRegular; padding-left:5px} -.dialect{text-align:center} \ No newline at end of file +.dialect{text-align:center} +.btn-page{margin:10px} + +th.annis_link, th.tla_orth_id{color:#333} +table a i.freq-icon{color:#AE2124;} + +td.colloc{text-align:left} + + +.fa-rotate-45 { + top:11px; + font-size:73%; + text-align:left; + color:#AE2124 !important; + -webkit-transform: rotate(45deg); + -moz-transform: rotate(45deg); + -ms-transform: rotate(45deg); + -o-transform: rotate(45deg); + transform: rotate(45deg); +} + +.fa-rotate-315 { + top:-9px; + font-size:73%; + text-align:left; + color:#AE2124 !important; + -webkit-transform: rotate(-45deg); + -moz-transform: rotate(-45deg); + -ms-transform: rotate(-45deg); + -o-transform: rotate(-45deg); + transform: rotate(-45deg); +} + +.scriptorium_logo{height:16px; + width:16px; + top: -2px; + position: relative; + } + +.tla_no_header{ +color:#41494e; +} + +.col-lg-12 > .page-header{margin-bottom: 0px !important; margin-top: 0px !important} +.col-lg-12 > .page-header > h2 {margin-top: 0px !important} + +.single_sense{margin-left:24px} + +.webservice_example_table{ border-collapse: collapse; + background: #fff; + border-radius: 10px; + /*overflow: hidden;*/ + width: 100%; + margin: 0 auto; + /*position: relative;*/ + } + +.webservice_example_table tr th{background: #36304a;} + +.webservice_example_table th{ + font-size: 18px; + color: #fff; + line-height: 1.2; + font-weight: unset;} + +.webservice_example_table td { padding: 5px !important;word-break: break-all;vertical-align:top;} + +.webservice_example_table tr:nth-child(even) { + background-color: #f5f5f5; +} + +.webservice_code{width:75% !important} \ No newline at end of file diff --git a/entry.cgi b/entry.cgi index ad4d282..d279c0b 100755 --- a/entry.cgi +++ b/entry.cgi @@ -43,23 +43,31 @@ def second_orth(orthstring): if second_orth is not None: if second_orth.group(2) != first: return second_orth.group(2) + dots - return "--" + return "–" def sense_list(sense_string): senses = sense_string.split("|||") - sense_html = "
    " + if len(senses) > 1: + sense_html = "
      " + opener = "
    1. " + closer = "" + else: + sense_html = "" + opener = '
      ' + closer = "
      " for sense in senses: definition = re.search(r'~~~(.*);;;', sense) if definition is not None: - sense_html += "
    2. " + definition.group(1).encode("utf8") + "
    3. " - sense_html += "
    " + sense_html += opener + definition.group(1).encode("utf8") + closer + if len(senses) > 1: + sense_html += "
" return sense_html def process_orthstring(orthstring, orefstring, cursor, cs_pos=None): forms = orthstring.split("|||") orefs = orefstring.split("|||") orth_html = '' - orth_html += '' + orth_html += '' for i, form in enumerate(forms): parts = form.split("\n") @@ -82,7 +90,7 @@ def process_orthstring(orthstring, orefstring, cursor, cs_pos=None): geo_string.encode("utf8") + '' + '" target="_new">' freq_data = get_freqs(distinct_orth) freq_info = """
FormDial.TLA form IDPOS ANNIS
FormDial.Form IDPOS Attestation
' + \ form_id.encode("utf8") + '' + \ gramstring.encode("utf8") + '\n" + return tablestring if __name__ == "__main__": form = cgi.FieldStorage() - word = cgi.escape(form.getvalue("coptic", "")).replace("(","").replace(")","").replace("=","") - dialect = cgi.escape(form.getvalue("dialect", "any")).replace("(","").replace(")","").replace("=","") - pos = cgi.escape(form.getvalue("pos", "any")).replace("(","").replace(")","").replace("=","") - definition = cgi.escape(form.getvalue("definition", "")).replace("(","").replace(")","").replace("=","") + params = {} + word = cgi.escape(form.getvalue("coptic", "")).replace("(","").replace(")","").replace("=","").strip() + dialect = cgi.escape(form.getvalue("dialect", "any")).replace("(","").replace(")","").replace("=","").strip() + pos = cgi.escape(form.getvalue("pos", "any")).replace("(","").replace(")","").replace("=","").strip() + definition = cgi.escape(form.getvalue("definition", "")).replace("(","").replace(")","").replace("=","").strip() def_search_type = cgi.escape(form.getvalue("def_search_type", "exact sequence")).replace("(","").replace(")","").replace("=","") - def_lang = cgi.escape(form.getvalue("lang", "any")).replace("(","").replace(")","").replace("=","") + def_lang = cgi.escape(form.getvalue("lang", "any")).replace("(","").replace(")","").replace("=","").strip() related = cgi.escape(form.getvalue("related", "false")).replace("(","").replace(")","").replace("=","") - quick_string = cgi.escape(form.getvalue("quick_search", "")).replace("(","").replace(")","").replace("=","") + quick_string = cgi.escape(form.getvalue("quick_search", "")).replace("(","").replace(")","").replace("=","").strip() + page = 1 + page = cgi.escape(form.getvalue("page", "1")).replace("(","").replace(")","").replace("=","").strip() + params["coptic"] = word + params["dialect"] = dialect + params["pos"] = pos + params["definition"] = definition + params["def_search_type"] = def_search_type + params["def_lang"] = def_lang + params["related"] = related + params["quick_search"] = quick_string + try: + page = abs(int(page)) + except: + page = 1 + params["page"] = page if quick_string != "": separated = separate_coptic(quick_string) def_search_type = "all words" @@ -306,7 +370,7 @@ if __name__ == "__main__": definition_desc = " definitions matching " + definition + " in language " + def_lang + "" if len(definition) > 0 else "" pos_desc = " restricted to POS tag " + pos if pos != "any" else "" search_desc = "You searched " + word_desc + dialect_desc + definition_desc + pos_desc - results_page = retrieve_entries(word, dialect, pos, definition, def_search_type, def_lang, search_desc) + results_page = retrieve_entries(word, dialect, pos, definition, def_search_type, def_lang, search_desc,params=params) ### related entry stuff if word != "": # nothing to do if no coptic word searched? diff --git a/templates/about.html b/templates/about.html index 36aabc2..4cfc23a 100644 --- a/templates/about.html +++ b/templates/about.html @@ -34,7 +34,7 @@

Projects

diff --git a/templates/howto.html b/templates/howto.html index a9971ce..c3fa13e 100644 --- a/templates/howto.html +++ b/templates/howto.html @@ -26,6 +26,21 @@

Quick search bar

  • English/French/German words - this will search for definitions containing all of these words in some language
  • A combination of Coptic and definition words - searches for entries matching both, in any dialect and definition language
  • + +

    Frequencies and collocations

    +

    The Coptic Dictionary Online is linked to Coptic Scriptorium corpora. Users can search for attestations of words, get frequencies and rank information or browse collocations of words using the following icons on each entry's page:

    + +
      +
    • - click on this icon next to a word form to search for it in Coptic Scriptorium corpora (you will be taken to ANNIS, the project's search interface)
    • +
    •   - pass over this icon to show frequencies and ranks for each word. For example, you can compare which is more frequent and how much: or ?
    • +
    • + + + - if available, this icon shows collocations, words that cooccur with this word form much more often than expected by chance
    • +
    + +

    Note: frequencies in the dictionary are cached and updated periodically. Numbers in ANNIS searches may differ slightly in some cases due to updates and/or slight differences in handling duplicate texts.

    +

    Import of data into spreadsheet

    You can import lemma entry data into a Google spreadsheet by copying formulas like the ones below into a cell of an empty spreadsheet.

    @@ -35,7 +50,8 @@

    Import of data into spreadsheet

    =IMPORTHTML("http://www.coptic-dictionary.org/results.cgi?coptic=ⲣⲱⲙⲉ&dialect=any&pos=any&definition=&def_search_type=exact+sequence&lang=any"; "table"; 1)search reply
    =IMPORTHTML("http://www.coptic-dictionary.org/results.cgi?coptic=ⲣⲱⲙⲉ"; "table"; 1)search reply, simple
    -

    Example:

    - +
    +

    Example:

    + diff --git a/templates/wrapper.html b/templates/wrapper.html index c50ae1e..b091692 100644 --- a/templates/wrapper.html +++ b/templates/wrapper.html @@ -8,7 +8,7 @@ - +