41 | ├── nn ├── __init__.py ├── utils.py └── tests.py ├── queries ├── js │ └── .gitkeep ├── disabled │ └── .gitkeep ├── resources │ └── .gitkeep ├── grammars │ ├── README.md │ ├── root.grammar │ ├── whatis.grammar │ ├── pic.grammar │ ├── opinion.grammar │ ├── counting.grammar │ ├── ja.grammar │ ├── news.grammar │ ├── flights.grammar │ ├── dictionary.grammar │ ├── sunpos.grammar │ ├── wiki.grammar │ ├── userloc.grammar │ ├── rand.grammar │ ├── geography.grammar │ └── places.grammar ├── README.md ├── examples │ ├── english.py │ └── plaintext.py ├── test.py ├── opinion.py └── whatis.py ├── static ├── audio │ └── tmp │ │ └── .gitkeep ├── 404.html ├── 500.html ├── img │ ├── vth.jpg │ ├── GPLv3.png │ ├── Blurb1.png │ ├── favicon.ico │ ├── flags │ │ ├── AD.png │ │ ├── AE.png │ │ ├── AF.png │ │ ├── AG.png │ │ ├── AI.png │ │ ├── AL.png │ │ ├── AM.png │ │ ├── AN.png │ │ ├── AO.png │ │ ├── AQ.png │ │ ├── AR.png │ │ ├── AS.png │ │ ├── AT.png │ │ ├── AU.png │ │ ├── AW.png │ │ ├── AX.png │ │ ├── AZ.png │ │ ├── BA.png │ │ ├── BB.png │ │ ├── BD.png │ │ ├── BE.png │ │ ├── BF.png │ │ ├── BG.png │ │ ├── BH.png │ │ ├── BI.png │ │ ├── BJ.png │ │ ├── BL.png │ │ ├── BM.png │ │ ├── BN.png │ │ ├── BO.png │ │ ├── BQ.png │ │ ├── BR.png │ │ ├── BS.png │ │ ├── BT.png │ │ ├── BV.png │ │ ├── BW.png │ │ ├── BY.png │ │ ├── BZ.png │ │ ├── CA.png │ │ ├── CC.png │ │ ├── CD.png │ │ ├── CF.png │ │ ├── CG.png │ │ ├── CH.png │ │ ├── CI.png │ │ ├── CK.png │ │ ├── CL.png │ │ ├── CM.png │ │ ├── CN.png │ │ ├── CO.png │ │ ├── CR.png │ │ ├── CU.png │ │ ├── CV.png │ │ ├── CW.png │ │ ├── CX.png │ │ ├── CY.png │ │ ├── CZ.png │ │ ├── DE.png │ │ ├── DJ.png │ │ ├── DK.png │ │ ├── DM.png │ │ ├── DO.png │ │ ├── DZ.png │ │ ├── EC.png │ │ ├── EE.png │ │ ├── EG.png │ │ ├── EH.png │ │ ├── ER.png │ │ ├── ES.png │ │ ├── ET.png │ │ ├── EU.png │ │ ├── FI.png │ │ ├── FJ.png │ │ ├── FK.png │ │ ├── FM.png │ │ ├── FO.png │ │ ├── FR.png │ │ ├── GA.png │ │ ├── GB.png │ │ ├── GD.png │ │ ├── GE.png │ │ ├── GF.png │ │ ├── GG.png │ │ ├── GH.png │ │ ├── GI.png │ │ ├── GL.png │ │ ├── GM.png │ │ ├── GN.png │ │ ├── GP.png │ │ ├── GQ.png │ │ ├── GR.png │ │ ├── GS.png │ │ ├── GT.png │ │ ├── GU.png │ │ ├── GW.png │ │ ├── GY.png │ │ ├── HK.png │ │ ├── HM.png │ │ ├── HN.png │ │ ├── HR.png │ │ ├── HT.png │ │ ├── HU.png │ │ ├── IC.png │ │ ├── ID.png │ │ ├── IE.png │ │ ├── IL.png │ │ ├── IM.png │ │ ├── IN.png │ │ ├── IO.png │ │ ├── IQ.png │ │ ├── IR.png │ │ ├── IS.png │ │ ├── IT.png │ │ ├── JE.png │ │ ├── JM.png │ │ ├── JO.png │ │ ├── JP.png │ │ ├── KE.png │ │ ├── KG.png │ │ ├── KH.png │ │ ├── KI.png │ │ ├── KM.png │ │ ├── KN.png │ │ ├── KP.png │ │ ├── KR.png │ │ ├── KW.png │ │ ├── KY.png │ │ ├── KZ.png │ │ ├── LA.png │ │ ├── LB.png │ │ ├── LC.png │ │ ├── LI.png │ │ ├── LK.png │ │ ├── LR.png │ │ ├── LS.png │ │ ├── LT.png │ │ ├── LU.png │ │ ├── LV.png │ │ ├── LY.png │ │ ├── MA.png │ │ ├── MC.png │ │ ├── MD.png │ │ ├── ME.png │ │ ├── MF.png │ │ ├── MG.png │ │ ├── MH.png │ │ ├── MK.png │ │ ├── ML.png │ │ ├── MM.png │ │ ├── MN.png │ │ ├── MO.png │ │ ├── MP.png │ │ ├── MQ.png │ │ ├── MR.png │ │ ├── MS.png │ │ ├── MT.png │ │ ├── MU.png │ │ ├── MV.png │ │ ├── MW.png │ │ ├── MX.png │ │ ├── MY.png │ │ ├── MZ.png │ │ ├── NA.png │ │ ├── NC.png │ │ ├── NE.png │ │ ├── NF.png │ │ ├── NG.png │ │ ├── NI.png │ │ ├── NL.png │ │ ├── NO.png │ │ ├── NP.png │ │ ├── NR.png │ │ ├── NU.png │ │ ├── NZ.png │ │ ├── OM.png │ │ ├── PA.png │ │ ├── PE.png │ │ ├── PF.png │ │ ├── PG.png │ │ ├── PH.png │ │ ├── PK.png │ │ ├── PL.png │ │ ├── PM.png │ │ ├── PN.png │ │ ├── PR.png │ │ ├── PS.png │ │ ├── PT.png │ │ ├── PW.png │ │ ├── PY.png │ │ ├── QA.png │ │ ├── RE.png │ │ ├── RO.png │ │ ├── RS.png │ │ ├── RU.png │ │ ├── RW.png │ │ ├── SA.png │ │ ├── SB.png │ │ ├── SC.png │ │ ├── SD.png │ │ ├── SE.png │ │ ├── SG.png │ │ ├── SH.png │ │ ├── SI.png │ │ ├── SJ.png │ │ ├── SK.png │ │ ├── SL.png │ │ ├── SM.png │ │ ├── SN.png │ │ ├── SO.png │ │ ├── SR.png │ │ ├── SS.png │ │ ├── ST.png │ │ ├── SV.png │ │ ├── SX.png │ │ ├── SY.png │ │ ├── SZ.png │ │ ├── TC.png │ │ ├── TD.png │ │ ├── TF.png │ │ ├── TG.png │ │ ├── TH.png │ │ ├── TJ.png │ │ ├── TK.png │ │ ├── TL.png │ │ ├── TM.png │ │ ├── TN.png │ │ ├── TO.png │ │ ├── TR.png │ │ ├── TT.png │ │ ├── TV.png │ │ ├── TW.png │ │ ├── TZ.png │ │ ├── UA.png │ │ ├── UG.png │ │ ├── UM.png │ │ ├── US.png │ │ ├── UY.png │ │ ├── UZ.png │ │ ├── VA.png │ │ ├── VC.png │ │ ├── VE.png │ │ ├── VG.png │ │ ├── VI.png │ │ ├── VN.png │ │ ├── VU.png │ │ ├── WF.png │ │ ├── WS.png │ │ ├── XK.png │ │ ├── XS.png │ │ ├── YE.png │ │ ├── YT.png │ │ ├── ZA.png │ │ ├── ZM.png │ │ ├── ZW.png │ │ ├── GB-ENG.png │ │ ├── GB-NIR.png │ │ ├── GB-SCT.png │ │ └── GB-WLS.png │ ├── apple-icon.png │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ ├── favicon-96x96.png │ ├── ms-icon-70x70.png │ ├── placeholder.png │ ├── sources │ │ ├── bb.is.png │ │ ├── dv.is.png │ │ ├── vb.is.png │ │ ├── bbl.is.png │ │ ├── mbl.is.png │ │ ├── ruv.is.png │ │ ├── mannlif.is.png │ │ ├── stundin.is.png │ │ ├── visir.is.png │ │ ├── hagstofa.is.png │ │ ├── heimildin.is.png │ │ ├── kjarninn.is.png │ │ ├── lemurinn.is.png │ │ ├── samstodin.is.png │ │ ├── frettabladid.is.png │ │ ├── hringbraut.is.png │ │ ├── kvennabladid.is.png │ │ ├── sedlabanki.is.png │ │ ├── visindavefur.is.png │ │ ├── eyjan.pressan.is.png │ │ ├── stjornlagarad.is.png │ │ ├── fjarmalaraduneyti.is.png │ │ ├── forsaetisraduneyti.is.png │ │ ├── innanrikisraduneyti.is.png │ │ └── utanrikisraduneyti.is.png │ ├── tree-example.png │ ├── ms-icon-144x144.png │ ├── ms-icon-150x150.png │ ├── ms-icon-310x310.png │ ├── android-icon-36x36.png │ ├── android-icon-48x48.png │ ├── android-icon-72x72.png │ ├── android-icon-96x96.png │ ├── apple-icon-114x114.png │ ├── apple-icon-120x120.png │ ├── apple-icon-144x144.png │ ├── apple-icon-152x152.png │ ├── apple-icon-180x180.png │ ├── apple-icon-57x57.png │ ├── apple-icon-60x60.png │ ├── apple-icon-72x72.png │ ├── apple-icon-76x76.png │ ├── greynir-logo-large.png │ ├── greynir_opengraph.png │ ├── maps │ │ ├── continents │ │ │ ├── AF.png │ │ │ ├── AN.png │ │ │ ├── AS.png │ │ │ ├── EU.png │ │ │ ├── NA.png │ │ │ ├── OC.png │ │ │ └── SA.png │ │ └── regions │ │ │ ├── Austfirðir.png │ │ │ ├── Austurland.png │ │ │ ├── Norðurland.png │ │ │ ├── Suðurland.png │ │ │ ├── Suðurnes.png │ │ │ ├── Vestfirðir.png │ │ │ ├── Vesturland.png │ │ │ ├── Mið-Austurland.png │ │ │ ├── Norðausturland.png │ │ │ ├── Norðvesturland.png │ │ │ └── Suðvesturland.png │ ├── tree-example-small.png │ ├── GreynirLogoVertical.png │ ├── android-icon-144x144.png │ ├── android-icon-192x192.png │ ├── GreynirLogoHoriz180x80.png │ ├── GreynirLogoVertical200.png │ ├── apple-icon-precomposed.png │ ├── mideind-horizontal-large.png │ ├── mideind-horizontal-small.png │ └── mideind-logo-transparent-medium.png ├── fonts │ ├── glyphicons-regular.woff │ ├── glyphicons-regular.woff2 │ ├── lato-v16-latin-700.woff │ ├── lato-v16-latin-700.woff2 │ ├── lato-v16-latin-italic.woff │ ├── lato-v16-latin-italic.woff2 │ ├── lato-v16-latin-regular.woff │ ├── lato-v16-latin-700italic.woff │ ├── lato-v16-latin-700italic.woff2 │ ├── lato-v16-latin-regular.woff2 │ ├── oswald-v31-latin-regular.woff │ └── oswald-v31-latin-regular.woff2 ├── files │ └── Greynir-Terms-2020-03-11.pdf ├── browserconfig.xml ├── robots.txt └── manifest.json ├── tests └── files │ ├── dummy_greynir_api_key.txt │ └── dummy_json_api_key.json ├── scripts ├── start.sh ├── tts_audio_cleanup.sh ├── prune_queries.sh ├── runtagger.sh ├── runreparse.sh ├── .ipython.py ├── runscraper.sh ├── shell.sh ├── gen_embla_rec.sh └── deploy.sh ├── vectors ├── requirements.txt ├── Vectors.conf └── README.md ├── scrapers ├── __init__.py └── README.md ├── processors ├── __init__.py └── README.md ├── templates ├── container-fluid.html ├── container-normal.html ├── similar.html ├── words │ ├── trends.html │ └── details.html ├── hover-infobox.html ├── 404.html ├── 500.html ├── parsefail.html ├── people │ ├── timeline.html │ └── recent.html └── articles.html ├── tools ├── showprofile.py ├── splitcopper.py ├── bracket.py ├── specialqmod_fix.py ├── langdetect.py ├── orn.py ├── addgender.py ├── missing_nouns.py ├── lookup.py ├── qinfo.py ├── qlog_copy.py ├── get_articles_by_url.py └── dbclean.py ├── .gitattributes ├── config ├── gunicorn_config.py ├── Index.conf ├── GreynirSimple.conf └── Greynir.conf ├── requirements.txt ├── tts.py ├── resources └── geo │ └── us_state_name2code.json ├── CONTRIBUTING.md ├── .github └── workflows │ └── codeql-analysis.yml ├── docs ├── shell.md └── setup_macos.md └── .gitignore /nn/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /queries/js/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /queries/disabled/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /queries/resources/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/audio/tmp/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/404.html: -------------------------------------------------------------------------------- 1 | ../templates/404.html -------------------------------------------------------------------------------- /static/500.html: -------------------------------------------------------------------------------- 1 | ../templates/500.html -------------------------------------------------------------------------------- /tests/files/dummy_greynir_api_key.txt: -------------------------------------------------------------------------------- 1 | 123456789 -------------------------------------------------------------------------------- /tests/files/dummy_json_api_key.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": 123456789 3 | } 4 | -------------------------------------------------------------------------------- /static/img/vth.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/vth.jpg -------------------------------------------------------------------------------- /static/img/GPLv3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/GPLv3.png -------------------------------------------------------------------------------- /static/img/Blurb1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/Blurb1.png -------------------------------------------------------------------------------- /static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/favicon.ico -------------------------------------------------------------------------------- /static/img/flags/AD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/AD.png -------------------------------------------------------------------------------- /static/img/flags/AE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/AE.png -------------------------------------------------------------------------------- /static/img/flags/AF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/AF.png -------------------------------------------------------------------------------- /static/img/flags/AG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/AG.png -------------------------------------------------------------------------------- /static/img/flags/AI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/AI.png -------------------------------------------------------------------------------- /static/img/flags/AL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/AL.png -------------------------------------------------------------------------------- /static/img/flags/AM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/AM.png -------------------------------------------------------------------------------- /static/img/flags/AN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/AN.png -------------------------------------------------------------------------------- /static/img/flags/AO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/AO.png -------------------------------------------------------------------------------- /static/img/flags/AQ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/AQ.png -------------------------------------------------------------------------------- /static/img/flags/AR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/AR.png -------------------------------------------------------------------------------- /static/img/flags/AS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/AS.png -------------------------------------------------------------------------------- /static/img/flags/AT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/AT.png -------------------------------------------------------------------------------- /static/img/flags/AU.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/AU.png -------------------------------------------------------------------------------- /static/img/flags/AW.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/AW.png -------------------------------------------------------------------------------- /static/img/flags/AX.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/AX.png -------------------------------------------------------------------------------- /static/img/flags/AZ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/AZ.png -------------------------------------------------------------------------------- /static/img/flags/BA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/BA.png -------------------------------------------------------------------------------- /static/img/flags/BB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/BB.png -------------------------------------------------------------------------------- /static/img/flags/BD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/BD.png -------------------------------------------------------------------------------- /static/img/flags/BE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/BE.png -------------------------------------------------------------------------------- /static/img/flags/BF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/BF.png -------------------------------------------------------------------------------- /static/img/flags/BG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/BG.png -------------------------------------------------------------------------------- /static/img/flags/BH.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/BH.png -------------------------------------------------------------------------------- /static/img/flags/BI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/BI.png -------------------------------------------------------------------------------- /static/img/flags/BJ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/BJ.png -------------------------------------------------------------------------------- /static/img/flags/BL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/BL.png -------------------------------------------------------------------------------- /static/img/flags/BM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/BM.png -------------------------------------------------------------------------------- /static/img/flags/BN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/BN.png -------------------------------------------------------------------------------- /static/img/flags/BO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/BO.png -------------------------------------------------------------------------------- /static/img/flags/BQ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/BQ.png -------------------------------------------------------------------------------- /static/img/flags/BR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/BR.png -------------------------------------------------------------------------------- /static/img/flags/BS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/BS.png -------------------------------------------------------------------------------- /static/img/flags/BT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/BT.png -------------------------------------------------------------------------------- /static/img/flags/BV.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/BV.png -------------------------------------------------------------------------------- /static/img/flags/BW.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/BW.png -------------------------------------------------------------------------------- /static/img/flags/BY.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/BY.png -------------------------------------------------------------------------------- /static/img/flags/BZ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/BZ.png -------------------------------------------------------------------------------- /static/img/flags/CA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/CA.png -------------------------------------------------------------------------------- /static/img/flags/CC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/CC.png -------------------------------------------------------------------------------- /static/img/flags/CD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/CD.png -------------------------------------------------------------------------------- /static/img/flags/CF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/CF.png -------------------------------------------------------------------------------- /static/img/flags/CG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/CG.png -------------------------------------------------------------------------------- /static/img/flags/CH.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/CH.png -------------------------------------------------------------------------------- /static/img/flags/CI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/CI.png -------------------------------------------------------------------------------- /static/img/flags/CK.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/CK.png -------------------------------------------------------------------------------- /static/img/flags/CL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/CL.png -------------------------------------------------------------------------------- /static/img/flags/CM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/CM.png -------------------------------------------------------------------------------- /static/img/flags/CN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/CN.png -------------------------------------------------------------------------------- /static/img/flags/CO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/CO.png -------------------------------------------------------------------------------- /static/img/flags/CR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/CR.png -------------------------------------------------------------------------------- /static/img/flags/CU.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/CU.png -------------------------------------------------------------------------------- /static/img/flags/CV.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/CV.png -------------------------------------------------------------------------------- /static/img/flags/CW.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/CW.png -------------------------------------------------------------------------------- /static/img/flags/CX.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/CX.png -------------------------------------------------------------------------------- /static/img/flags/CY.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/CY.png -------------------------------------------------------------------------------- /static/img/flags/CZ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/CZ.png -------------------------------------------------------------------------------- /static/img/flags/DE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/DE.png -------------------------------------------------------------------------------- /static/img/flags/DJ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/DJ.png -------------------------------------------------------------------------------- /static/img/flags/DK.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/DK.png -------------------------------------------------------------------------------- /static/img/flags/DM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/DM.png -------------------------------------------------------------------------------- /static/img/flags/DO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/DO.png -------------------------------------------------------------------------------- /static/img/flags/DZ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/DZ.png -------------------------------------------------------------------------------- /static/img/flags/EC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/EC.png -------------------------------------------------------------------------------- /static/img/flags/EE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/EE.png -------------------------------------------------------------------------------- /static/img/flags/EG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/EG.png -------------------------------------------------------------------------------- /static/img/flags/EH.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/EH.png -------------------------------------------------------------------------------- /static/img/flags/ER.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/ER.png -------------------------------------------------------------------------------- /static/img/flags/ES.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/ES.png -------------------------------------------------------------------------------- /static/img/flags/ET.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/ET.png -------------------------------------------------------------------------------- /static/img/flags/EU.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/EU.png -------------------------------------------------------------------------------- /static/img/flags/FI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/FI.png -------------------------------------------------------------------------------- /static/img/flags/FJ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/FJ.png -------------------------------------------------------------------------------- /static/img/flags/FK.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/FK.png -------------------------------------------------------------------------------- /static/img/flags/FM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/FM.png -------------------------------------------------------------------------------- /static/img/flags/FO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/FO.png -------------------------------------------------------------------------------- /static/img/flags/FR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/FR.png -------------------------------------------------------------------------------- /static/img/flags/GA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/GA.png -------------------------------------------------------------------------------- /static/img/flags/GB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/GB.png -------------------------------------------------------------------------------- /static/img/flags/GD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/GD.png -------------------------------------------------------------------------------- /static/img/flags/GE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/GE.png -------------------------------------------------------------------------------- /static/img/flags/GF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/GF.png -------------------------------------------------------------------------------- /static/img/flags/GG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/GG.png -------------------------------------------------------------------------------- /static/img/flags/GH.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/GH.png -------------------------------------------------------------------------------- /static/img/flags/GI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/GI.png -------------------------------------------------------------------------------- /static/img/flags/GL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/GL.png -------------------------------------------------------------------------------- /static/img/flags/GM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/GM.png -------------------------------------------------------------------------------- /static/img/flags/GN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/GN.png -------------------------------------------------------------------------------- /static/img/flags/GP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/GP.png -------------------------------------------------------------------------------- /static/img/flags/GQ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/GQ.png -------------------------------------------------------------------------------- /static/img/flags/GR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/GR.png -------------------------------------------------------------------------------- /static/img/flags/GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/GS.png -------------------------------------------------------------------------------- /static/img/flags/GT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/GT.png -------------------------------------------------------------------------------- /static/img/flags/GU.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/GU.png -------------------------------------------------------------------------------- /static/img/flags/GW.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/GW.png -------------------------------------------------------------------------------- /static/img/flags/GY.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/GY.png -------------------------------------------------------------------------------- /static/img/flags/HK.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/HK.png -------------------------------------------------------------------------------- /static/img/flags/HM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/HM.png -------------------------------------------------------------------------------- /static/img/flags/HN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/HN.png -------------------------------------------------------------------------------- /static/img/flags/HR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/HR.png -------------------------------------------------------------------------------- /static/img/flags/HT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/HT.png -------------------------------------------------------------------------------- /static/img/flags/HU.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/HU.png -------------------------------------------------------------------------------- /static/img/flags/IC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/IC.png -------------------------------------------------------------------------------- /static/img/flags/ID.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/ID.png -------------------------------------------------------------------------------- /static/img/flags/IE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/IE.png -------------------------------------------------------------------------------- /static/img/flags/IL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/IL.png -------------------------------------------------------------------------------- /static/img/flags/IM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/IM.png -------------------------------------------------------------------------------- /static/img/flags/IN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/IN.png -------------------------------------------------------------------------------- /static/img/flags/IO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/IO.png -------------------------------------------------------------------------------- /static/img/flags/IQ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/IQ.png -------------------------------------------------------------------------------- /static/img/flags/IR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/IR.png -------------------------------------------------------------------------------- /static/img/flags/IS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/IS.png -------------------------------------------------------------------------------- /static/img/flags/IT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/IT.png -------------------------------------------------------------------------------- /static/img/flags/JE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/JE.png -------------------------------------------------------------------------------- /static/img/flags/JM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/JM.png -------------------------------------------------------------------------------- /static/img/flags/JO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/JO.png -------------------------------------------------------------------------------- /static/img/flags/JP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/JP.png -------------------------------------------------------------------------------- /static/img/flags/KE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/KE.png -------------------------------------------------------------------------------- /static/img/flags/KG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/KG.png -------------------------------------------------------------------------------- /static/img/flags/KH.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/KH.png -------------------------------------------------------------------------------- /static/img/flags/KI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/KI.png -------------------------------------------------------------------------------- /static/img/flags/KM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/KM.png -------------------------------------------------------------------------------- /static/img/flags/KN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/KN.png -------------------------------------------------------------------------------- /static/img/flags/KP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/KP.png -------------------------------------------------------------------------------- /static/img/flags/KR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/KR.png -------------------------------------------------------------------------------- /static/img/flags/KW.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/KW.png -------------------------------------------------------------------------------- /static/img/flags/KY.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/KY.png -------------------------------------------------------------------------------- /static/img/flags/KZ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/KZ.png -------------------------------------------------------------------------------- /static/img/flags/LA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/LA.png -------------------------------------------------------------------------------- /static/img/flags/LB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/LB.png -------------------------------------------------------------------------------- /static/img/flags/LC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/LC.png -------------------------------------------------------------------------------- /static/img/flags/LI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/LI.png -------------------------------------------------------------------------------- /static/img/flags/LK.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/LK.png -------------------------------------------------------------------------------- /static/img/flags/LR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/LR.png -------------------------------------------------------------------------------- /static/img/flags/LS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/LS.png -------------------------------------------------------------------------------- /static/img/flags/LT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/LT.png -------------------------------------------------------------------------------- /static/img/flags/LU.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/LU.png -------------------------------------------------------------------------------- /static/img/flags/LV.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/LV.png -------------------------------------------------------------------------------- /static/img/flags/LY.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/LY.png -------------------------------------------------------------------------------- /static/img/flags/MA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/MA.png -------------------------------------------------------------------------------- /static/img/flags/MC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/MC.png -------------------------------------------------------------------------------- /static/img/flags/MD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/MD.png -------------------------------------------------------------------------------- /static/img/flags/ME.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/ME.png -------------------------------------------------------------------------------- /static/img/flags/MF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/MF.png -------------------------------------------------------------------------------- /static/img/flags/MG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/MG.png -------------------------------------------------------------------------------- /static/img/flags/MH.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/MH.png -------------------------------------------------------------------------------- /static/img/flags/MK.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/MK.png -------------------------------------------------------------------------------- /static/img/flags/ML.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/ML.png -------------------------------------------------------------------------------- /static/img/flags/MM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/MM.png -------------------------------------------------------------------------------- /static/img/flags/MN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/MN.png -------------------------------------------------------------------------------- /static/img/flags/MO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/MO.png -------------------------------------------------------------------------------- /static/img/flags/MP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/MP.png -------------------------------------------------------------------------------- /static/img/flags/MQ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/MQ.png -------------------------------------------------------------------------------- /static/img/flags/MR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/MR.png -------------------------------------------------------------------------------- /static/img/flags/MS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/MS.png -------------------------------------------------------------------------------- /static/img/flags/MT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/MT.png -------------------------------------------------------------------------------- /static/img/flags/MU.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/MU.png -------------------------------------------------------------------------------- /static/img/flags/MV.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/MV.png -------------------------------------------------------------------------------- /static/img/flags/MW.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/MW.png -------------------------------------------------------------------------------- /static/img/flags/MX.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/MX.png -------------------------------------------------------------------------------- /static/img/flags/MY.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/MY.png -------------------------------------------------------------------------------- /static/img/flags/MZ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/MZ.png -------------------------------------------------------------------------------- /static/img/flags/NA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/NA.png -------------------------------------------------------------------------------- /static/img/flags/NC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/NC.png -------------------------------------------------------------------------------- /static/img/flags/NE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/NE.png -------------------------------------------------------------------------------- /static/img/flags/NF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/NF.png -------------------------------------------------------------------------------- /static/img/flags/NG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/NG.png -------------------------------------------------------------------------------- /static/img/flags/NI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/NI.png -------------------------------------------------------------------------------- /static/img/flags/NL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/NL.png -------------------------------------------------------------------------------- /static/img/flags/NO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/NO.png -------------------------------------------------------------------------------- /static/img/flags/NP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/NP.png -------------------------------------------------------------------------------- /static/img/flags/NR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/NR.png -------------------------------------------------------------------------------- /static/img/flags/NU.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/NU.png -------------------------------------------------------------------------------- /static/img/flags/NZ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/NZ.png -------------------------------------------------------------------------------- /static/img/flags/OM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/OM.png -------------------------------------------------------------------------------- /static/img/flags/PA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/PA.png -------------------------------------------------------------------------------- /static/img/flags/PE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/PE.png -------------------------------------------------------------------------------- /static/img/flags/PF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/PF.png -------------------------------------------------------------------------------- /static/img/flags/PG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/PG.png -------------------------------------------------------------------------------- /static/img/flags/PH.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/PH.png -------------------------------------------------------------------------------- /static/img/flags/PK.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/PK.png -------------------------------------------------------------------------------- /static/img/flags/PL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/PL.png -------------------------------------------------------------------------------- /static/img/flags/PM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/PM.png -------------------------------------------------------------------------------- /static/img/flags/PN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/PN.png -------------------------------------------------------------------------------- /static/img/flags/PR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/PR.png -------------------------------------------------------------------------------- /static/img/flags/PS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/PS.png -------------------------------------------------------------------------------- /static/img/flags/PT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/PT.png -------------------------------------------------------------------------------- /static/img/flags/PW.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/PW.png -------------------------------------------------------------------------------- /static/img/flags/PY.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/PY.png -------------------------------------------------------------------------------- /static/img/flags/QA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/QA.png -------------------------------------------------------------------------------- /static/img/flags/RE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/RE.png -------------------------------------------------------------------------------- /static/img/flags/RO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/RO.png -------------------------------------------------------------------------------- /static/img/flags/RS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/RS.png -------------------------------------------------------------------------------- /static/img/flags/RU.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/RU.png -------------------------------------------------------------------------------- /static/img/flags/RW.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/RW.png -------------------------------------------------------------------------------- /static/img/flags/SA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/SA.png -------------------------------------------------------------------------------- /static/img/flags/SB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/SB.png -------------------------------------------------------------------------------- /static/img/flags/SC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/SC.png -------------------------------------------------------------------------------- /static/img/flags/SD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/SD.png -------------------------------------------------------------------------------- /static/img/flags/SE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/SE.png -------------------------------------------------------------------------------- /static/img/flags/SG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/SG.png -------------------------------------------------------------------------------- /static/img/flags/SH.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/SH.png -------------------------------------------------------------------------------- /static/img/flags/SI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/SI.png -------------------------------------------------------------------------------- /static/img/flags/SJ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/SJ.png -------------------------------------------------------------------------------- /static/img/flags/SK.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/SK.png -------------------------------------------------------------------------------- /static/img/flags/SL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/SL.png -------------------------------------------------------------------------------- /static/img/flags/SM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/SM.png -------------------------------------------------------------------------------- /static/img/flags/SN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/SN.png -------------------------------------------------------------------------------- /static/img/flags/SO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/SO.png -------------------------------------------------------------------------------- /static/img/flags/SR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/SR.png -------------------------------------------------------------------------------- /static/img/flags/SS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/SS.png -------------------------------------------------------------------------------- /static/img/flags/ST.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/ST.png -------------------------------------------------------------------------------- /static/img/flags/SV.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/SV.png -------------------------------------------------------------------------------- /static/img/flags/SX.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/SX.png -------------------------------------------------------------------------------- /static/img/flags/SY.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/SY.png -------------------------------------------------------------------------------- /static/img/flags/SZ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/SZ.png -------------------------------------------------------------------------------- /static/img/flags/TC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/TC.png -------------------------------------------------------------------------------- /static/img/flags/TD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/TD.png -------------------------------------------------------------------------------- /static/img/flags/TF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/TF.png -------------------------------------------------------------------------------- /static/img/flags/TG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/TG.png -------------------------------------------------------------------------------- /static/img/flags/TH.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/TH.png -------------------------------------------------------------------------------- /static/img/flags/TJ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/TJ.png -------------------------------------------------------------------------------- /static/img/flags/TK.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/TK.png -------------------------------------------------------------------------------- /static/img/flags/TL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/TL.png -------------------------------------------------------------------------------- /static/img/flags/TM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/TM.png -------------------------------------------------------------------------------- /static/img/flags/TN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/TN.png -------------------------------------------------------------------------------- /static/img/flags/TO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/TO.png -------------------------------------------------------------------------------- /static/img/flags/TR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/TR.png -------------------------------------------------------------------------------- /static/img/flags/TT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/TT.png -------------------------------------------------------------------------------- /static/img/flags/TV.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/TV.png -------------------------------------------------------------------------------- /static/img/flags/TW.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/TW.png -------------------------------------------------------------------------------- /static/img/flags/TZ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/TZ.png -------------------------------------------------------------------------------- /static/img/flags/UA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/UA.png -------------------------------------------------------------------------------- /static/img/flags/UG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/UG.png -------------------------------------------------------------------------------- /static/img/flags/UM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/UM.png -------------------------------------------------------------------------------- /static/img/flags/US.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/US.png -------------------------------------------------------------------------------- /static/img/flags/UY.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/UY.png -------------------------------------------------------------------------------- /static/img/flags/UZ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/UZ.png -------------------------------------------------------------------------------- /static/img/flags/VA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/VA.png -------------------------------------------------------------------------------- /static/img/flags/VC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/VC.png -------------------------------------------------------------------------------- /static/img/flags/VE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/VE.png -------------------------------------------------------------------------------- /static/img/flags/VG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/VG.png -------------------------------------------------------------------------------- /static/img/flags/VI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/VI.png -------------------------------------------------------------------------------- /static/img/flags/VN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/VN.png -------------------------------------------------------------------------------- /static/img/flags/VU.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/VU.png -------------------------------------------------------------------------------- /static/img/flags/WF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/WF.png -------------------------------------------------------------------------------- /static/img/flags/WS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/WS.png -------------------------------------------------------------------------------- /static/img/flags/XK.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/XK.png -------------------------------------------------------------------------------- /static/img/flags/XS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/XS.png -------------------------------------------------------------------------------- /static/img/flags/YE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/YE.png -------------------------------------------------------------------------------- /static/img/flags/YT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/YT.png -------------------------------------------------------------------------------- /static/img/flags/ZA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/ZA.png -------------------------------------------------------------------------------- /static/img/flags/ZM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/ZM.png -------------------------------------------------------------------------------- /static/img/flags/ZW.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/ZW.png -------------------------------------------------------------------------------- /static/img/apple-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/apple-icon.png -------------------------------------------------------------------------------- /scripts/start.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | GREYNIR_DB_HOST=greynir.is GREYNIR_PORT=5000 python main.py 4 | -------------------------------------------------------------------------------- /static/img/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/favicon-16x16.png -------------------------------------------------------------------------------- /static/img/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/favicon-32x32.png -------------------------------------------------------------------------------- /static/img/favicon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/favicon-96x96.png -------------------------------------------------------------------------------- /static/img/flags/GB-ENG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/GB-ENG.png -------------------------------------------------------------------------------- /static/img/flags/GB-NIR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/GB-NIR.png -------------------------------------------------------------------------------- /static/img/flags/GB-SCT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/GB-SCT.png -------------------------------------------------------------------------------- /static/img/flags/GB-WLS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/flags/GB-WLS.png -------------------------------------------------------------------------------- /static/img/ms-icon-70x70.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/ms-icon-70x70.png -------------------------------------------------------------------------------- /static/img/placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/placeholder.png -------------------------------------------------------------------------------- /static/img/sources/bb.is.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/sources/bb.is.png -------------------------------------------------------------------------------- /static/img/sources/dv.is.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/sources/dv.is.png -------------------------------------------------------------------------------- /static/img/sources/vb.is.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/sources/vb.is.png -------------------------------------------------------------------------------- /static/img/tree-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/tree-example.png -------------------------------------------------------------------------------- /static/img/ms-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/ms-icon-144x144.png -------------------------------------------------------------------------------- /static/img/ms-icon-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/ms-icon-150x150.png -------------------------------------------------------------------------------- /static/img/ms-icon-310x310.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/ms-icon-310x310.png -------------------------------------------------------------------------------- /static/img/sources/bbl.is.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/sources/bbl.is.png -------------------------------------------------------------------------------- /static/img/sources/mbl.is.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/sources/mbl.is.png -------------------------------------------------------------------------------- /static/img/sources/ruv.is.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/sources/ruv.is.png -------------------------------------------------------------------------------- /static/img/android-icon-36x36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/android-icon-36x36.png -------------------------------------------------------------------------------- /static/img/android-icon-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/android-icon-48x48.png -------------------------------------------------------------------------------- /static/img/android-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/android-icon-72x72.png -------------------------------------------------------------------------------- /static/img/android-icon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/android-icon-96x96.png -------------------------------------------------------------------------------- /static/img/apple-icon-114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/apple-icon-114x114.png -------------------------------------------------------------------------------- /static/img/apple-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/apple-icon-120x120.png -------------------------------------------------------------------------------- /static/img/apple-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/apple-icon-144x144.png -------------------------------------------------------------------------------- /static/img/apple-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/apple-icon-152x152.png -------------------------------------------------------------------------------- /static/img/apple-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/apple-icon-180x180.png -------------------------------------------------------------------------------- /static/img/apple-icon-57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/apple-icon-57x57.png -------------------------------------------------------------------------------- /static/img/apple-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/apple-icon-60x60.png -------------------------------------------------------------------------------- /static/img/apple-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/apple-icon-72x72.png -------------------------------------------------------------------------------- /static/img/apple-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/apple-icon-76x76.png -------------------------------------------------------------------------------- /static/img/greynir-logo-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/greynir-logo-large.png -------------------------------------------------------------------------------- /static/img/greynir_opengraph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/greynir_opengraph.png -------------------------------------------------------------------------------- /static/img/maps/continents/AF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/maps/continents/AF.png -------------------------------------------------------------------------------- /static/img/maps/continents/AN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/maps/continents/AN.png -------------------------------------------------------------------------------- /static/img/maps/continents/AS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/maps/continents/AS.png -------------------------------------------------------------------------------- /static/img/maps/continents/EU.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/maps/continents/EU.png -------------------------------------------------------------------------------- /static/img/maps/continents/NA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/maps/continents/NA.png -------------------------------------------------------------------------------- /static/img/maps/continents/OC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/maps/continents/OC.png -------------------------------------------------------------------------------- /static/img/maps/continents/SA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/maps/continents/SA.png -------------------------------------------------------------------------------- /static/img/sources/mannlif.is.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/sources/mannlif.is.png -------------------------------------------------------------------------------- /static/img/sources/stundin.is.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/sources/stundin.is.png -------------------------------------------------------------------------------- /static/img/sources/visir.is.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/sources/visir.is.png -------------------------------------------------------------------------------- /static/img/tree-example-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/tree-example-small.png -------------------------------------------------------------------------------- /static/img/GreynirLogoVertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/GreynirLogoVertical.png -------------------------------------------------------------------------------- /static/img/android-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/android-icon-144x144.png -------------------------------------------------------------------------------- /static/img/android-icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/android-icon-192x192.png -------------------------------------------------------------------------------- /static/img/sources/hagstofa.is.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/sources/hagstofa.is.png -------------------------------------------------------------------------------- /static/img/sources/heimildin.is.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/sources/heimildin.is.png -------------------------------------------------------------------------------- /static/img/sources/kjarninn.is.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/sources/kjarninn.is.png -------------------------------------------------------------------------------- /static/img/sources/lemurinn.is.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/sources/lemurinn.is.png -------------------------------------------------------------------------------- /static/img/sources/samstodin.is.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/sources/samstodin.is.png -------------------------------------------------------------------------------- /static/fonts/glyphicons-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/fonts/glyphicons-regular.woff -------------------------------------------------------------------------------- /static/fonts/glyphicons-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/fonts/glyphicons-regular.woff2 -------------------------------------------------------------------------------- /static/fonts/lato-v16-latin-700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/fonts/lato-v16-latin-700.woff -------------------------------------------------------------------------------- /static/fonts/lato-v16-latin-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/fonts/lato-v16-latin-700.woff2 -------------------------------------------------------------------------------- /static/img/GreynirLogoHoriz180x80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/GreynirLogoHoriz180x80.png -------------------------------------------------------------------------------- /static/img/GreynirLogoVertical200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/GreynirLogoVertical200.png -------------------------------------------------------------------------------- /static/img/apple-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/apple-icon-precomposed.png -------------------------------------------------------------------------------- /static/img/maps/regions/Austfirðir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/maps/regions/Austfirðir.png -------------------------------------------------------------------------------- /static/img/maps/regions/Austurland.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/maps/regions/Austurland.png -------------------------------------------------------------------------------- /static/img/maps/regions/Norðurland.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/maps/regions/Norðurland.png -------------------------------------------------------------------------------- /static/img/maps/regions/Suðurland.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/maps/regions/Suðurland.png -------------------------------------------------------------------------------- /static/img/maps/regions/Suðurnes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/maps/regions/Suðurnes.png -------------------------------------------------------------------------------- /static/img/maps/regions/Vestfirðir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/maps/regions/Vestfirðir.png -------------------------------------------------------------------------------- /static/img/maps/regions/Vesturland.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/maps/regions/Vesturland.png -------------------------------------------------------------------------------- /static/img/sources/frettabladid.is.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/sources/frettabladid.is.png -------------------------------------------------------------------------------- /static/img/sources/hringbraut.is.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/sources/hringbraut.is.png -------------------------------------------------------------------------------- /static/img/sources/kvennabladid.is.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/sources/kvennabladid.is.png -------------------------------------------------------------------------------- /static/img/sources/sedlabanki.is.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/sources/sedlabanki.is.png -------------------------------------------------------------------------------- /static/img/sources/visindavefur.is.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/sources/visindavefur.is.png -------------------------------------------------------------------------------- /static/fonts/lato-v16-latin-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/fonts/lato-v16-latin-italic.woff -------------------------------------------------------------------------------- /static/fonts/lato-v16-latin-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/fonts/lato-v16-latin-italic.woff2 -------------------------------------------------------------------------------- /static/fonts/lato-v16-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/fonts/lato-v16-latin-regular.woff -------------------------------------------------------------------------------- /static/img/mideind-horizontal-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/mideind-horizontal-large.png -------------------------------------------------------------------------------- /static/img/mideind-horizontal-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/mideind-horizontal-small.png -------------------------------------------------------------------------------- /static/img/sources/eyjan.pressan.is.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/sources/eyjan.pressan.is.png -------------------------------------------------------------------------------- /static/img/sources/stjornlagarad.is.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/sources/stjornlagarad.is.png -------------------------------------------------------------------------------- /static/files/Greynir-Terms-2020-03-11.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/files/Greynir-Terms-2020-03-11.pdf -------------------------------------------------------------------------------- /static/fonts/lato-v16-latin-700italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/fonts/lato-v16-latin-700italic.woff -------------------------------------------------------------------------------- /static/fonts/lato-v16-latin-700italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/fonts/lato-v16-latin-700italic.woff2 -------------------------------------------------------------------------------- /static/fonts/lato-v16-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/fonts/lato-v16-latin-regular.woff2 -------------------------------------------------------------------------------- /static/fonts/oswald-v31-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/fonts/oswald-v31-latin-regular.woff -------------------------------------------------------------------------------- /static/fonts/oswald-v31-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/fonts/oswald-v31-latin-regular.woff2 -------------------------------------------------------------------------------- /static/img/maps/regions/Mið-Austurland.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/maps/regions/Mið-Austurland.png -------------------------------------------------------------------------------- /static/img/maps/regions/Norðausturland.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/maps/regions/Norðausturland.png -------------------------------------------------------------------------------- /static/img/maps/regions/Norðvesturland.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/maps/regions/Norðvesturland.png -------------------------------------------------------------------------------- /static/img/maps/regions/Suðvesturland.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/maps/regions/Suðvesturland.png -------------------------------------------------------------------------------- /static/img/sources/fjarmalaraduneyti.is.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/sources/fjarmalaraduneyti.is.png -------------------------------------------------------------------------------- /static/img/sources/forsaetisraduneyti.is.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/sources/forsaetisraduneyti.is.png -------------------------------------------------------------------------------- /static/img/sources/innanrikisraduneyti.is.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/sources/innanrikisraduneyti.is.png -------------------------------------------------------------------------------- /static/img/sources/utanrikisraduneyti.is.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/sources/utanrikisraduneyti.is.png -------------------------------------------------------------------------------- /static/img/mideind-logo-transparent-medium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mideind/GreynirServer/HEAD/static/img/mideind-logo-transparent-medium.png -------------------------------------------------------------------------------- /vectors/requirements.txt: -------------------------------------------------------------------------------- 1 | cffi==1.14.0 2 | gensim==3.8.2 3 | psycopg2cffi==2.8.1 4 | pycparser==2.20 5 | SQLAlchemy==1.4.0 6 | typing_extensions>=3.10.0 7 | -------------------------------------------------------------------------------- /scripts/tts_audio_cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Delete all text-to-speech audio scratch files older than 1 day (24 hours) 4 | find /usr/share/nginx/greynir.is/static/audio/tmp/* -mtime +1 -exec rm {} \; 5 | -------------------------------------------------------------------------------- /scripts/prune_queries.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Purge all logged queries in queries table older than 30 days 4 | # 5 | 6 | psql -h "greynir.is" -U reynir -d scraper -c \ 7 | "DELETE FROM queries WHERE timestamp < NOW() - INTERVAL '30 days';" 8 | -------------------------------------------------------------------------------- /scrapers/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | Greynir: Natural language processing for Icelandic 4 | 5 | scraper folder 6 | 7 | This is the location to put custom scraper helpers for 8 | specific URL roots. 9 | 10 | """ 11 | -------------------------------------------------------------------------------- /processors/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | Greynir: Natural language processing for Icelandic 4 | 5 | Processors folder 6 | 7 | This is the location to put custom processors for 8 | parsed trees and tokens. 9 | 10 | """ 11 | -------------------------------------------------------------------------------- /templates/container-fluid.html: -------------------------------------------------------------------------------- 1 | {% extends "container.html" %} 2 | 3 | {% block container %} 4 | 5 |
| 7 | 8 | | 9 |10 | | 11 |
41 | Beiðnin olli innri villu í vefþjóni Greynis.
44 |The request caused an internal server error.
45 || Tími | 8 | {% else %} 9 |Dags. | 10 | {% endif %} 11 | 12 |Fyrirsögn | 13 | 14 | 15 | 16 | {% for article in articles %} 17 |
|---|
|
29 | |
33 |
39 |
Engar greinar fundust.
47 | 48 | {% endif %} -------------------------------------------------------------------------------- /queries/grammars/flights.grammar: -------------------------------------------------------------------------------- 1 | # Grammar for the flights query module 2 | 3 | Query → 4 | QFlights 5 | 6 | QFlights → QFlightsQuery '?'? 7 | 8 | QFlightsQuery → 9 | QFlightsArrivalQuery 10 | | QFlightsDepartureQuery 11 | 12 | QFlightsArrivalQuery → 13 | # Arrivals at Icelandic airports, e.g. 14 | # Hver er lendingartími næstu vélar í Reykjavík 15 | # Hvenær kemur næsta flug til Keflavíkur frá Kaupmannahöfn 16 | QFlightsWhenArr QFlightsNextPlane QFlightsPathDesc 17 | 18 | QFlightsWhenArr → 19 | QFlightsWhen "lendir" 20 | | QFlightsWhen "kemur" 21 | | QFlightsWhen "mætir" 22 | | "hver" "er" "lendingartími" 23 | | "hver" "er" "lendingartíminn" "fyrir" 24 | 25 | QFlightsDepartureQuery → 26 | # Departures from Icelandic airports, e.g. 27 | # Hver er brottfarartími næstu vélar til London 28 | # Hvenær flýgur næsta vél af stað frá Keflavík til Köben 29 | QFlightsWhenDepNextPlane QFlightsPathDesc 30 | 31 | QFlightsAfStað → "af" "stað" 32 | 33 | QFlightsWhenDepNextPlane → 34 | QFlightsWhen "leggur" QFlightsNextPlane QFlightsAfStað 35 | | QFlightsWhenDep QFlightsNextPlane QFlightsAfStað? 36 | 37 | QFlightsNextPlane → 38 | "næsta" QFlightsPlane/fall 39 | | "næstu" QFlightsPlane/fall 40 | 41 | QFlightsWhenDep → 42 | QFlightsWhen "fer" 43 | | QFlightsWhen "er" 44 | | QFlightsWhen "flýgur" 45 | | "hver" "er" "brottfarartími" 46 | | "hver" "er" "brottfarartíminn" "fyrir" 47 | 48 | QFlightsWhen → 49 | "hvenær" | "klukkan" "hvað" 50 | 51 | QFlightsPlane/fall -> 52 | 'flug:hk'_et/fall 53 | | 'flugvél:kvk'_et/fall 54 | | 'vél:kvk'_et/fall 55 | 56 | QFlightsPathDesc → 57 | # At least one endpoint of the flight (in any order), e.g. 58 | # frá Keflavík til Reykjavíkur 59 | # til Akureyrar 60 | QFlightsPrepLoc QFlightsPrepLoc 61 | > QFlightsPrepLoc 62 | 63 | QFlightsPrepLoc → 64 | "til" QFlightsArrLoc_ef 65 | | "frá" QFlightsDepLoc_þgf 66 | | "í" QFlightsArrLoc_þgf 67 | | "á" QFlightsArrLoc_þgf 68 | | "á" QFlightsArrLoc_þf 69 | 70 | QFlightsArrLoc/fall → 71 | Nl/fall 72 | 73 | QFlightsDepLoc/fall → 74 | Nl/fall 75 | 76 | $tag(keep) QFlightsArrLoc/fall 77 | $tag(keep) QFlightsDepLoc/fall 78 | -------------------------------------------------------------------------------- /queries/grammars/dictionary.grammar: -------------------------------------------------------------------------------- 1 | # Grammar for the dictionary query module 2 | 3 | Query → 4 | QDictQuery '?'? 5 | 6 | QDictQuery → 7 | QDictWordQuery 8 | 9 | QDictWordQuery → 10 | "hvað" "segir" QDictDict "um" "orðið" QDictSubjectNom 11 | | "hvað" "stendur" QDictInDictionary "um" "orðið" QDictSubjectNom 12 | | QDictWhatWhich "er" QDictDefinition "á" "orðinu" QDictSubjectNom QDictInDictionary? 13 | | "flettu" "upp" "orðinu" QDictSubjectNom QDictInDictionary? 14 | | "flettu" "orðinu" QDictSubjectNom "upp" QDictInDictionary? 15 | | "fletta" "upp" "orðinu" QDictSubjectNom QDictInDictionary? 16 | | "fletta" "orðinu" QDictSubjectNom "upp" QDictInDictionary? 17 | | QDictCanYou "flett" "upp" "orðinu" QDictSubjectNom QDictInDictionary? 18 | | "hvernig" "skilgreinir" QDictDict "orðið" QDictSubjectNom 19 | | "hvernig" "er" "orðið" QDictSubjectNom "skilgreint" QDictInDictionary? 20 | | QDictDefinition "á" "orðinu" QDictSubjectNom 21 | | "skilgreindu" "orðið" QDictSubjectNom 22 | | "komdu" "með" "skilgreininguna" "á" "orðinu" QDictSubjectNom 23 | | "komdu" "með" "skilgreiningu" "á" "orðinu" QDictSubjectNom 24 | | "komdu" "með" "orðabókarskilgreiningu" "á" QDictSubjectNom 25 | | "komdu" "með" "orðabókarskilgreininguna" "á" QDictSubjectNom 26 | | QDictKnowHowTo "að" "skilgreina" "orðið" QDictSubjectNom 27 | | QDictCanYou "skilgreint" "orðið" QDictSubjectNom 28 | 29 | QDictInDictionary → 30 | "í" "orðabók" | "í" "orðabókinni" 31 | | "í" "íslenskri" "orðabók" | "í" "íslensku" "orðabókinni" 32 | 33 | QDictDict → 34 | "orðabók" | "orðabókin" | "íslensk" "orðabók" | "íslenska" "orðabókin" 35 | 36 | QDictWhatWhich → 37 | "hvað" | "hver" 38 | 39 | QDictCanYou → 40 | "getur" "þú" | "geturðu" 41 | 42 | QDictKnowHowTo → 43 | "kannt" "þú" | "kanntu" 44 | 45 | QDictDefinition → 46 | "skilgreining" | "skilgreiningin" 47 | | "orðabókarskilgreining" | "orðabókarskilgreiningin" 48 | | "orðabókaskilgreining" | "orðabókaskilgreiningin" 49 | | "skilgreining" "íslenskrar"? "orðabókar" | "skilgreining" "íslensku"? "orðabókarinnar" 50 | | "skilgreining" "í" "íslenskri"? "orðabók" | "skilgreiningin" "í" "íslenskri"? "orðabók" 51 | 52 | QDictSubjectNom → 53 | Nl 54 | 55 | $score(+35) QDictQuery 56 | 57 | -------------------------------------------------------------------------------- /tools/get_articles_by_url.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # 3 | # Given a list of URLs, fetch the corresponding articles 4 | # from the database and write them to a JSON file. 5 | # 6 | 7 | import sys, os, json 8 | 9 | # Look for modules in parent directory 10 | sys.path.insert(1, os.path.join(sys.path[0], "..")) 11 | 12 | from db import SessionContext 13 | from db.models import Article 14 | from tokenizer import correct_spaces 15 | 16 | 17 | def tokens2text(tokens): 18 | """Reassemble text from tokens.""" 19 | text = "" 20 | if not tokens: 21 | return text 22 | tokens = json.loads(tokens) 23 | if not tokens: 24 | return text 25 | # Paragraphs 26 | for p in tokens: 27 | tx = "" 28 | # Sentences 29 | for s in p: 30 | # Tokens 31 | for t in s: 32 | tx += t["x"] + " " 33 | tx = correct_spaces(tx) 34 | text += tx + "\n\n" 35 | return text 36 | 37 | 38 | def main(): 39 | # Read list of URLs from file 40 | with open("urls.txt", "r") as f: 41 | lines = f.readlines() 42 | 43 | articles = list() 44 | 45 | with SessionContext(read_only=True) as session: 46 | for i in lines: 47 | try: 48 | # Fetch article from database and add to list 49 | url = i 50 | q = ( 51 | session.query( 52 | Article.url, Article.timestamp, Article.tokens, Article.heading 53 | ) 54 | .filter(Article.url == url) 55 | .all() 56 | ) 57 | if len(q) != 1: 58 | continue 59 | 60 | r = q[0] 61 | 62 | item = { 63 | "url": r.url, 64 | "timestamp": r.timestamp.isoformat(), 65 | "title": r.heading, 66 | "text": tokens2text(r.tokens), 67 | } 68 | 69 | articles.append(item) 70 | except Exception as e: 71 | print(f"Error processing {i}: {e}") 72 | 73 | with open("articles.json", "w") as f: 74 | json.dump(articles, f, indent=4, ensure_ascii=False) 75 | 76 | 77 | if __name__ == "__main__": 78 | main() 79 | -------------------------------------------------------------------------------- /queries/opinion.py: -------------------------------------------------------------------------------- 1 | """ 2 | 3 | Greynir: Natural language processing for Icelandic 4 | 5 | Opinion query response module 6 | 7 | Copyright (C) 2023 Miðeind ehf. 8 | 9 | This program is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program. If not, see http://www.gnu.org/licenses/. 20 | 21 | 22 | This module handles queries related to Embla's opinions. 23 | 24 | """ 25 | 26 | 27 | from datetime import datetime, timedelta, timezone 28 | 29 | from queries import Query, QueryStateDict 30 | from queries.util import gen_answer, read_grammar_file 31 | from tree import Result, Node 32 | 33 | 34 | _OPINION_QTYPE = "Opinion" 35 | 36 | 37 | # Indicate that this module wants to handle parse trees for queries, 38 | # as opposed to simple literal text strings 39 | HANDLE_TREE = True 40 | 41 | # The grammar nonterminals this module wants to handle 42 | QUERY_NONTERMINALS = {"QOpinion"} 43 | 44 | # The context-free grammar for the queries recognized by this plug-in module 45 | GRAMMAR = read_grammar_file("opinion") 46 | 47 | 48 | def QOpinionQuery(node: Node, params: QueryStateDict, result: Result) -> None: 49 | result["qtype"] = _OPINION_QTYPE 50 | 51 | 52 | def QOpinionSubject(node: Node, params: QueryStateDict, result: Result) -> None: 53 | result["subject_nom"] = result._nominative 54 | 55 | 56 | def sentence(state: QueryStateDict, result: Result) -> None: 57 | """Called when sentence processing is complete""" 58 | q: Query = state["query"] 59 | 60 | if "qtype" not in result or "subject_nom" not in result: 61 | q.set_error("E_QUERY_NOT_UNDERSTOOD") 62 | return 63 | 64 | # OK, we've successfully matched a query type 65 | subj: str = result["subject_nom"] 66 | answer = "Ég hef enga sérstaka skoðun í þeim efnum." 67 | q.set_answer(*gen_answer(answer)) 68 | q.set_qtype(_OPINION_QTYPE) 69 | q.set_context(dict(subject=subj)) 70 | q.set_key(subj) 71 | q.set_expires(datetime.now(timezone.utc) + timedelta(hours=24)) 72 | -------------------------------------------------------------------------------- /queries/grammars/sunpos.grammar: -------------------------------------------------------------------------------- 1 | # Grammar for the sunpos query module 2 | 3 | Query → 4 | QSunQuery '?'? 5 | 6 | QSunQuery → 7 | # Hvenær er birting í Reykjavík á morgun 8 | # Klukkan hvað var myrkur á Norðfirði í gær 9 | QSunWhen QSunPositions QSunPlaceAndTime? 10 | | QSunSunheight QSunPlaceAndTime? 11 | 12 | QSunPlaceAndTime → 13 | QSunDate QSunLocation? 14 | > QSunLocation QSunDate 15 | > QSunLocation 16 | 17 | QSunWhen → 18 | "hvenær" | "klukkan" "hvað" 19 | 20 | QSunIsWillWas → 21 | 'vera' | 'verða' 22 | 23 | 24 | QSunSunheight → 25 | "hver" QSunIsWillWas QSunSólarhæð 26 | 27 | QSunSólarhæð → 28 | 'sólarhæð' 29 | | "hæð" 'sól' 30 | | "hæð" 'Sól' 31 | | 'Hæð' 'Sól' 32 | 33 | QSunPositions → 34 | QSunMiðnætti 35 | | QSunDögun 36 | | QSunBirting 37 | | QSunSólris 38 | | QSunHádegi 39 | | QSunSólarlag 40 | | QSunMyrkur 41 | | QSunDagsetur 42 | 43 | QSunMiðnætti → 44 | QSunIsWillWas "miðnætti" 45 | 46 | QSunDögun → 47 | QSunIsWillWas "dögun" 48 | 49 | QSunBirting → 50 | QSunIsWillWas "birting" 51 | | "mun" "birta" 52 | 53 | QSunSólris → 54 | 'rísa' "sólin" 55 | | "mun" "sólin" "rísa" 56 | | QSunIsWillWas "sólarupprás" 57 | | "kemur" "sólin" "upp" 58 | | "kom" "sólin" "upp" 59 | | "fór" "sólin" "upp" 60 | | "fer" "sólin" "upp" 61 | 62 | QSunHádegi → 63 | QSunIsWillWas "hádegi" 64 | 65 | QSunSólarlag → 66 | "sest" "sólin" 67 | | "settist" "sólin" 68 | | "mun" "sólin" "setjast" 69 | | "fer" "sólin" "niður" 70 | | "fór" "sólin" "niður" 71 | | QSunIsWillWas 'sólsetur' 72 | | QSunIsWillWas "sólarlag" 73 | 74 | QSunMyrkur → 75 | QSunIsWillWas "myrkur" 76 | 77 | QSunDagsetur → 78 | QSunIsWillWas "dagsetur" 79 | 80 | 81 | QSunDate → 82 | QSunToday 83 | | QSunYesterday 84 | | QSunTomorrow 85 | 86 | QSunToday → 87 | "í" "dag" | "í_kvöld" | "í_morgun" | "í" "nótt" | 'Í' 'Dag' 88 | 89 | QSunYesterday → 90 | "í_gær" 91 | 92 | QSunTomorrow → 93 | "á_morgun" 94 | 95 | 96 | QSunLocation → 97 | QSunCapitalRegion 98 | | QSunInArbitraryLocation 99 | 100 | QSunCapitalRegion → 101 | "á" "höfuðborgarsvæðinu" | "fyrir" "höfuðborgarsvæðið" 102 | | "í" "reykjavík" | "fyrir" "reykjavík" 103 | | "í" "höfuðborginni" | "fyrir" "höfuðborgina" 104 | | "á" "reykjavíkursvæðinu" | "fyrir" "reykjavíkursvæðið" 105 | | "í" "borginni" | "fyrir" "borgina" 106 | 107 | QSunInArbitraryLocation → 108 | fs_þgf QSunArbitraryLocation 109 | 110 | QSunArbitraryLocation → 111 | Nl_þgf -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | # For most projects, this workflow file will not need changing; you simply need 2 | # to commit it to your repository. 3 | # 4 | # You may wish to alter this file to override the set of languages analyzed, 5 | # or to provide custom queries or build logic. 6 | # 7 | # ******** NOTE ******** 8 | # We have attempted to detect the languages in your repository. Please check 9 | # the `language` matrix defined below to confirm you have the correct set of 10 | # supported CodeQL languages. 11 | # 12 | name: "CodeQL" 13 | 14 | on: 15 | push: 16 | branches: [ master ] 17 | pull_request: 18 | # The branches below must be a subset of the branches above 19 | branches: [ master ] 20 | schedule: 21 | - cron: '41 8 * * 3' 22 | 23 | jobs: 24 | analyze: 25 | name: Analyze 26 | runs-on: ubuntu-latest 27 | permissions: 28 | actions: read 29 | contents: read 30 | security-events: write 31 | 32 | strategy: 33 | fail-fast: false 34 | matrix: 35 | language: [ 'javascript', 'python' ] 36 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] 37 | # Learn more: 38 | # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed 39 | 40 | steps: 41 | - name: Checkout repository 42 | uses: actions/checkout@v4 43 | 44 | # Initializes the CodeQL tools for scanning. 45 | - name: Initialize CodeQL 46 | uses: github/codeql-action/init@v1 47 | with: 48 | languages: ${{ matrix.language }} 49 | # If you wish to specify custom queries, you can do so here or in a config file. 50 | # By default, queries listed here will override any specified in a config file. 51 | # Prefix the list here with "+" to use these queries and those in the config file. 52 | # queries: ./path/to/local/query, your-org/your-repo/queries@main 53 | 54 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). 55 | # If this step fails, then you should remove it and run the build manually (see below) 56 | - name: Autobuild 57 | uses: github/codeql-action/autobuild@v1 58 | 59 | # ℹ️ Command-line programs to run using the OS shell. 60 | # 📚 https://git.io/JvXDl 61 | 62 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines 63 | # and modify them (or add more) to build your code if your project 64 | # uses a compiled language 65 | 66 | #- run: | 67 | # make bootstrap 68 | # make release 69 | 70 | - name: Perform CodeQL Analysis 71 | uses: github/codeql-action/analyze@v1 72 | -------------------------------------------------------------------------------- /queries/examples/plaintext.py: -------------------------------------------------------------------------------- 1 | """ 2 | 3 | Greynir: Natural language processing for Icelandic 4 | 5 | Example of a plain text query processor module. 6 | 7 | Copyright (C) 2023 Miðeind ehf. 8 | 9 | This program is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program. If not, see http://www.gnu.org/licenses/. 20 | 21 | 22 | This module is an example of a plug-in query response module 23 | for the Greynir query subsystem. It handles plain text queries, i.e. 24 | ones that do not require parsing the query text gramatically. For 25 | this purpose it only needs to implement the handle_plain_text() 26 | function, as shown below. 27 | 28 | 29 | """ 30 | 31 | from datetime import datetime, timedelta, timezone 32 | 33 | from queries import Query 34 | 35 | 36 | def handle_plain_text(q: Query) -> bool: 37 | """Handle a plain text query, contained in the q parameter 38 | which is an instance of the query.Query class. 39 | Returns True if the query was handled, and in that case 40 | the appropriate properties on the Query instance have 41 | been set, such as the answer and the query type (qtype). 42 | If the query is not recognized, returns False.""" 43 | ql = q.query_lower.rstrip("?") 44 | 45 | if ql == "er þetta prufa": 46 | q.set_qtype("PlaintextExample") 47 | 48 | # Set answer 49 | answer = "Já" 50 | voice = "Já, þetta er prufa" 51 | response = dict(answer=answer) 52 | q.set_answer(response, answer, voice) 53 | 54 | # Caching (optional) 55 | q.set_expires(datetime.now(timezone.utc) + timedelta(hours=24)) 56 | 57 | # Context (optional) 58 | # q.set_context(dict(subject="Prufuviðfangsefni")) 59 | 60 | # Source (optional) 61 | # q.set_source("Prufumódúll") 62 | 63 | # Beautify query for end user display (optional) 64 | # q.set_beautified_query(ql.upper()) 65 | 66 | # Javascript command to execute client-side (optional) 67 | # q.set_command("2 + 2") 68 | 69 | # URL to be opened by client (optional) 70 | # q.set_url("https://miðeind.is") 71 | 72 | return True 73 | 74 | return False 75 | -------------------------------------------------------------------------------- /queries/grammars/wiki.grammar: -------------------------------------------------------------------------------- 1 | # Grammar for the wiki query module 2 | 3 | Query → 4 | QWiki 5 | 6 | QWiki → 7 | QWikiQuery '?'? | QWikiWhatIsQuery '?'? 8 | 9 | QWikiQuery → 10 | # These take the subject in the nominative case 11 | QWikiSubjectNf "í" QWikipedia 12 | 13 | # These take the subject in the accusative case 14 | | "hvað" "segir" QWikipedia "um" QWikiSubjectÞf 15 | | "hvað" "stendur" "í" QWikipedia "um" QWikiSubjectÞf 16 | | "hvað" "stendur" "á" QWikipedia "um" QWikiSubjectÞf 17 | | "hvað" "stendur" "um" QWikiSubjectÞf "í" QWikipedia 18 | | "hvað" "getur" "þú" "sagt" QWikiMeOrUsÞgf? "um" QWikiSubjectÞf 19 | | "hvað" "geturðu" "sagt" QWikiMeOrUsÞgf? "um" QWikiSubjectÞf 20 | | "hvað" "getur" QWikipedia "sagt" QWikiMeOrUsÞgf? "um" QWikiSubjectÞf 21 | | "hvaða" "upplýsingar" "ert" "þú" "með" "um" QWikiSubjectÞf 22 | | "hvaða" "upplýsingar" "ertu" "með" "um" QWikiSubjectÞf 23 | | "hvaða" "upplýsingar" "er" QWikipedia "með" "um" QWikiSubjectÞf 24 | | "hvaða" "upplýsingum" "býr" QWikipedia "yfir" "varðandi" QWikiSubjectÞf 25 | | "hvaða" "upplýsingum" "býrðu" "yfir" "varðandi" QWikiSubjectÞf 26 | | "hvað" "myndi" QWikipedia "segja" QWikiMeOrUsÞgf? "um" QWikiSubjectÞf 27 | | "fræddu" QWikiMeOrUsÞf "um" QWikiSubjectÞf 28 | | "geturðu" "frætt" QWikiMeOrUsÞf "um" QWikiSubjectÞf 29 | | "nennirðu" "að" "fræða" QWikiMeOrUsÞf "um" QWikiSubjectÞf 30 | 31 | # These take the subject in the dative case 32 | | "segðu" QWikiMeOrUsÞgf "frá" QWikiSubjectÞgf 33 | | "segðu" QWikiMeOrUsÞgf "eitthvað" "um" QWikiSubjectÞf 34 | | "flettu" "upp" QWikiSubjectÞgf "í" QWikipedia 35 | | "geturðu" "flett" "upp" QWikiSubjectÞgf "í" QWikipedia 36 | | "nennirðu" "að" "fletta" "upp" QWikiSubjectÞgf "í" QWikipedia 37 | | "gætirðu" "flett" "upp" QWikiSubjectÞgf "í" QWikipedia 38 | 39 | QWikiWhatIsQuery → 40 | "hvað" "er" QWikiSubjectNlNf | 41 | "hvað" "eru" QWikiSubjectNlNf 42 | 43 | QWikiMeOrUsÞgf → 44 | "mér" | "okkur" 45 | 46 | QWikiMeOrUsÞf → 47 | "mig" | "okkur" 48 | 49 | QWikiSubjectNf → 50 | QWikiPrevSubjectNf | QWikiSubjectNlNf 51 | 52 | QWikiSubjectNlNf → 53 | Nl_nf 54 | 55 | QWikiSubjectÞf → 56 | QWikiPrevSubjectÞf | QWikiSubjectNlÞf 57 | 58 | QWikiSubjectNlÞf → 59 | Nl_þf 60 | 61 | QWikiSubjectÞgf → 62 | QWikiPrevSubjectÞgf | QWikiSubjectNlÞgf 63 | 64 | QWikiSubjectNlÞgf → 65 | Nl_þgf 66 | 67 | QWikiPrevSubjectNf → 68 | "hann" | "hún" | "það" 69 | 70 | QWikiPrevSubjectÞf → 71 | "hann" | "hana" | "það" 72 | 73 | QWikiPrevSubjectÞgf → 74 | "honum" | "henni" | "því" 75 | 76 | QWikipedia → 77 | {wikipedia_variations} 78 | 79 | $score(+35) QWikiPrevSubjectNf 80 | $score(+35) QWikiPrevSubjectÞf 81 | $score(+35) QWikiPrevSubjectÞf 82 | 83 | $score(+35) QWikiQuery 84 | -------------------------------------------------------------------------------- /queries/grammars/userloc.grammar: -------------------------------------------------------------------------------- 1 | # Grammar for the userloc query module 2 | 3 | Query → 4 | QUserLocation 5 | 6 | QUserLocation → QUserLocationQuery '?'? 7 | 8 | QUserLocationQuery → 9 | QUserLocationCurrent | QUserLocationPostcode | QUserLocationCountry 10 | 11 | QUserLocationCurrent → 12 | "hvar" "er" "ég" QULocEiginlega? QULocLocated? QULocInTheWorld? QULocNow? 13 | | "hvar" QULocInTheWorld "er" "ég" QULocEiginlega? QULocLocated? QULocNow? 14 | | "hvað" "er" "ég" QULocEiginlega? QULocLocated? QULocInTheWorld? QULocNow? 15 | | "veistu" "hvar" "ég" "er" QULocEiginlega? QULocInTheWorld? QULocNow? 16 | | "veist" "þú" "hvar" "ég" "er" QULocEiginlega? QULocInTheWorld? QULocNow? 17 | | "hver" "er" "staðsetning" "mín"? QULocEiginlega? QULocInTheWorld? QULocNow? 18 | | "hver" "er" "staðsetningin" "mín"? QULocEiginlega? QULocInTheWorld? QULocNow? 19 | | "hvar" "erum" "við" QULocEiginlega? QULocLocatedFemAndPlural? QULocInTheWorld? QULocNow? 20 | | "staðsetning" "mín"? QULocInTheWorld? QULocNow? 21 | | QULocWhichStreet QULocEiginlega? QULocLocated? QULocInTheWorld? QULocNow? 22 | 23 | QUserLocationPostcode → 24 | "í" "hvaða" "póstnúmeri" "er" "ég" QULocEiginlega? QULocLocated? QULocNow? 25 | | "hvaða" "póstnúmeri" "er" "ég" QULocEiginlega? QULocLocated? "í" QULocNow? 26 | | "í" "hvaða" "póstnúmeri" "erum" "við" QULocEiginlega? QULocLocated? QULocNow? 27 | | "hvaða" "póstnúmeri" "erum" "við" QULocEiginlega? QULocLocated? "í" QULocNow? 28 | 29 | QUserLocationCountry → 30 | QULocPreposition "hvaða" "landi" "er" "ég" QULocLocated? QULocNow? 31 | | QULocPreposition "hvaða" "landi" "erum" "við" QULocLocated? QULocNow? 32 | | "hvaða" "landi" "er" "ég" QULocLocated? QULocPreposition QULocNow? 33 | | "hvaða" "landi" "erum" "við" QULocLocated? QULocPreposition QULocNow? 34 | 35 | QULocWhichStreet → 36 | QULocPreposition "hvaða" "götu" "er" "ég" QULocLocated? QULocNow? 37 | | QULocPreposition "hvaða" "götu" "erum" "við" QULocLocated? QULocNow? 38 | 39 | QULocPreposition → 40 | "á" | "í" 41 | 42 | QULocEiginlega → 43 | "eiginlega" 44 | 45 | QULocLocated → 46 | QULocLocatedMasc | QULocLocatedFemAndPlural 47 | 48 | QULocLocatedMasc → 49 | "staddur" | "staðsettur" | "niðurkominn" | "niður" "kominn" 50 | 51 | QULocLocatedFemAndPlural → 52 | "stödd" | "staðsett" | "niðurkomin" | "niður" "komin" 53 | 54 | QULocInTheWorld → 55 | "í" "heiminum" 56 | | "í" "veröldinni" 57 | | "á" "hnettinum" 58 | | "á" "jörðinni" 59 | | "á" "landinu" 60 | | "á" "Íslandi" 61 | | "á" "yfirborði" "jarðar" 62 | | "á" "jarðkringlunni" 63 | | "á" "plánetunni" "jörð"? 64 | 65 | QULocNow → 66 | "nákvæmlega"? QULocNowGeneric 67 | 68 | QULocNowGeneric → 69 | "nú" | "akkúrat"? "núna" | "eins" "og" "stendur" | "sem" "stendur" 70 | | "í" "augnablikinu" | "á" "þessari" "stundu" | "hér" "og" "nú" 71 | 72 | $score(+35) QUserLocation 73 | -------------------------------------------------------------------------------- /queries/grammars/rand.grammar: -------------------------------------------------------------------------------- 1 | # Grammar for the rand query module 2 | 3 | Query → 4 | QRandom 5 | 6 | QRandom → QRandomQuery '?'? 7 | 8 | QRandomQuery → 9 | QRandomDieRoll | QRandomBetween | QRandomHeadsOrTails # | QRandomMultipleDiceRoll 10 | 11 | QRandomHeadsOrTails → 12 | "fiskur" "eða" "skjaldarmerki" | "skjaldarmerki" "eða" "fiskur" 13 | | "kastaðu" "upp"? "peningi" | "kastaðu" "upp"? "pening" | "kastaðu" "upp"? "krónu" 14 | 15 | QRandomDieRoll → 16 | "kastaðu" QRandomDiceSides? QRandomDie QRandomForMe? 17 | | "kastaðu" QRandomForMe? QRandomDiceSides? QRandomDie 18 | | "kasta" QRandomDiceSides? QRandomDie QRandomForMe? 19 | | "nennirðu" "að" "kasta" QRandomDiceSides? QRandomDie QRandomForMe? 20 | | "geturðu" "kastað" QRandomDiceSides? QRandomDie QRandomForMe? 21 | | "geturðu" "kastað" QRandomForMe? QRandomDiceSides? QRandomDie 22 | | "kastaðu" "upp" "á" "teningnum" QRandomForMe? 23 | | "kastaðu" "upp" "á" "teningi" QRandomForMe? 24 | 25 | # QRandomMultipleDiceRoll → 26 | # "kastaðu" QRandNumber "teningum" QRandomForMe? 27 | # | "kastaðu" QRandomForMe? QRandNumber "teningum" 28 | # | "kasta" QRandNumber "teningum" QRandomForMe? 29 | # | "nennirðu" "að" "kasta" QRandNumber "teningum" QRandomForMe? 30 | # | "geturðu" "kastað" QRandNumber "teningum" QRandomForMe? 31 | # | "geturðu" "kastað" QRandomForMe? QRandNumber "teningum" 32 | 33 | QRandomForMe → 34 | "fyrir" "mig" 35 | 36 | QRandomDie → 37 | # Allow "tening" (accusative) to make it a bit more robust. Common error. 38 | "teningi" | "tening" | "teningnum" | "teningunum" 39 | 40 | QRandomDiceSides → 41 | QRandNumber "hliða" 42 | 43 | QRandomBetween → 44 | QRandAction "tölu" "á"? "milli" QRandNumber "og" QRandNumber QRandRand? 45 | | QRandAction "tölu" QRandRand? "á"? "milli" QRandNumber "og" QRandNumber 46 | | QRandAction QRandRand? "tölu" "á"? "milli" QRandNumber "og" QRandNumber 47 | 48 | QRandAction → 49 | "veldu" | "veldu" "fyrir" "mig" | "veldu" "handa" "mér" | "veldu" "fyrir" "okkur" 50 | | "geturðu" "valið" "fyrir" "mig" | "getur" "þú" "valið" "fyrir" "mig" 51 | | "gætir" "þú" "valið" "fyrir" "mig" | "værirðu" "til" "í" "að" "velja" "fyrir" "mig" 52 | | "nefndu" | "nefndu" "fyrir" "mig" | "nefndu" "fyrir" "okkur" 53 | | "komdu" "með" 54 | | "geturðu" "komið" "með" | "getur" "þú" "komið" "með" 55 | | "gætirðu" "komið" "með" | "gætir" "þú" "komið" "með" 56 | | "gefðu" "mér" 57 | | "geturðu" "gefið" "mér" | "getur" "þú" "gefið" "mér" 58 | | "gætirðu" "gefið" "mér" | "gætir" "þú" "gefið" "mér" 59 | 60 | QRandRand → 61 | # "Að handahófi" is incorrect but we'll allow it 62 | "af" "handahófi" | "að" "handahófi" 63 | 64 | QRandNumber → 65 | # to is a declinable number word ('tveir/tvo/tveim/tveggja') 66 | # töl is an undeclinable number word ('sautján') 67 | # tala is a number ('17') 68 | to | töl | tala | "núll" 69 | 70 | $score(+35) QRandom 71 | -------------------------------------------------------------------------------- /docs/shell.md: -------------------------------------------------------------------------------- 1 | # Using the Greynir Shell 2 | 3 | To start the Greynir shell, activate the virtual environment and install IPython: 4 | 5 | ```bash 6 | pip install ipython 7 | ``` 8 | 9 | You can then run the following command from the repository root: 10 | 11 | ```bash 12 | bash scripts/shell.sh 13 | ``` 14 | 15 | This will launch an [IPython](http://ipython.readthedocs.io) shell, a superior alternative to the standard Python REPL. Features include syntax highlighting, auto-pretty-printing, auto-indentation, smart autocompletion, persistent history across sessions, integrated access to pdb and the profiler, and various introspection tools. 16 | 17 | To enable auto-reloading of modules prior to every command, run the following command: 18 | 19 | ```python 20 | %autoreload 2 21 | ``` 22 | 23 | The shell has been configured to automatically import Greynir's database models and create a (commit-disabled) database session when launched. The Greynir parser is also imported. 24 | 25 | * `s` - SQLAlchemy database session 26 | * `g` - Instance of the [Greynir](https://github.com/mideind/GreynirEngine) parser. 27 | 28 | For an overview of Greynir's database models, see `db/models.py`. 29 | 30 | Shell auto-imports are configured in `.ipython.py` in the repository root. Additional local user settings can be configured in `~/.ipython/profile_default`. 31 | 32 | ### Querying the database 33 | 34 | Get the titles of recent articles: 35 | 36 | ```python 37 | In [1]: s.query(Article.heading).order_by(desc(Article.timestamp)) \ 38 | ...: .limit(5).all() 39 | Out[1]: 40 | [('Guðjón Pétur í KA'), 41 | ('Parkland-ungmennin sem breyttu heiminum'), 42 | ('Airwaves-helgin gerð upp'), 43 | ('Sturridge í vondum málum?'), 44 | ('Óttar ekki áfram hjá Trelleborg')] 45 | ``` 46 | 47 | Show recent persons identified by Greynir's Named Entity Recognition module: 48 | 49 | ``` 50 | In [1]: s.query(Person.name, Person.title) \ 51 | ...: .order_by(Person.timestamp).limit(5).all() 52 | Out[6]: 53 | [('Þórður Snær Júlíusson', 'ritstjóri Kjarnans'), 54 | ('Jón Magnús Kristjánsson', 'yfirlæknir bráðalækninga á Landspítalanum'), 55 | ('Davíð Oddsson', 'ritstjóri Morgunblaðsins'), 56 | ('Þórdís Kolbrún Reykfjörð Gylfadóttir', 'varaformaður Sjálfstæðisflokksins'), 57 | ('Ingólfur Helgason', 'fyrrverandi forstjóri Kaupþings á Íslandi')] 58 | ``` 59 | 60 | ### Parsing with Greynir 61 | 62 | ``` 63 | In [1]: sent = g.parse_single("Mikið væri það skemmtilegt fyrir Gunna.") 64 | In [2]: print(sent.tree.view) 65 | Out[2]: 66 | P 67 | +-S-MAIN 68 | +-IP 69 | +-ADVP 70 | +-ao: 'Mikið' 71 | +-VP-SEQ 72 | +-VP 73 | +-so_et_p3: 'væri' 74 | +-NP-SUBJ 75 | +-pfn_hk_et_nf: 'það' 76 | +-ADJP 77 | +-lo_sb_nf_et_hk: 'skemmtilegt' 78 | +-PP 79 | +-fs_þf: 'fyrir' 80 | +-NP 81 | +-person_þf_kk: 'Gunna' 82 | +-'.' 83 | In [3]: sent.tree.nouns 84 | Out[3]: ['Gunni'] 85 | In [4]: sent.tree.lemmas 86 | Out[4]: ['mikið', 'vera', 'það', 'skemmtilegur', 'fyrir', 'Gunni', '.'] 87 | 88 | ``` 89 | -------------------------------------------------------------------------------- /nn/utils.py: -------------------------------------------------------------------------------- 1 | """ 2 | Greynir: Natural language processing for Icelandic 3 | 4 | Copyright (C) 2023 Miðeind ehf. 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see http://www.gnu.org/licenses/. 17 | 18 | """ 19 | 20 | from typing import List, Tuple, Dict 21 | 22 | import tokenizer 23 | 24 | from tokenizer import Tok 25 | from reynir.binparser import BIN_Token 26 | from reynir import bintokenizer 27 | 28 | 29 | def prep_text_for_tokenizer(text: str) -> str: 30 | return "[[" + "]][[".join(text.split("\n")) + "]]" 31 | 32 | 33 | def index_text(text: str) -> Tuple[Dict[int, List[int]], Dict[int, str]]: 34 | """Segments contiguous (Icelandic) text into paragraphs and sentences 35 | and returns: 36 | dictionary of sentence indices to sentences 37 | dictionary of paragraph index to constituent sentence indices""" 38 | text = prep_text_for_tokenizer(text) 39 | tok_stream = bintokenizer.tokenize(text) 40 | 41 | pgs = tokenizer.paragraphs(tok_stream) 42 | pg_idx_to_sent_idx: Dict[int, List[int]] = dict() 43 | sent_idx_to_sent: Dict[int, str] = dict() 44 | curr_sent_idx = 0 45 | curr_pg_idx = 0 46 | 47 | for pg in pgs: 48 | sent_idxs: List[int] = [] 49 | for _, sent in pg: 50 | curr_sent: List[Tok] = list(filter(BIN_Token.is_understood, sent)) 51 | curr_sent_text = tokenizer.normalized_text_from_tokens(curr_sent) 52 | sent_idxs.append(curr_sent_idx) 53 | sent_idx_to_sent[curr_sent_idx] = curr_sent_text 54 | curr_sent_idx += 1 55 | pg_idx_to_sent_idx[curr_pg_idx] = sent_idxs 56 | curr_pg_idx += 1 57 | return pg_idx_to_sent_idx, sent_idx_to_sent 58 | 59 | 60 | def split_text(text: str) -> List[List[str]]: 61 | """Segments contiguous (Icelandic) text into paragraphs and sentences 62 | and returns a list of lists 63 | """ 64 | text = prep_text_for_tokenizer(text) 65 | tok_stream = bintokenizer.tokenize(text) 66 | pgs = tokenizer.paragraphs(tok_stream) 67 | data: List[List[str]] = [] 68 | for pg in pgs: 69 | pg_data: List[str] = [] 70 | for _, sentence in pg: 71 | sentence = list(filter(BIN_Token.is_understood, sentence)) 72 | sentence_text = tokenizer.normalized_text_from_tokens(sentence) 73 | pg_data.append(sentence_text) 74 | data.append(pg_data) 75 | return data 76 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | .pytest_cache/ 4 | .mypy_cache/ 5 | typings/ 6 | *.py[cod] 7 | *.o 8 | *.so 9 | *.exe 10 | 11 | # Compressed DAWG trees 12 | *.dawg 13 | 14 | # Pickled DAWG trees 15 | *.pickle 16 | 17 | # ngram models 18 | ngram*.txt 19 | 20 | # Mypy 21 | mypy.ini 22 | 23 | # Training data files 24 | *.pairs 25 | *.tgz 26 | *.zip 27 | *.tsv 28 | 29 | # Experimental Python stuff 30 | rnn.py 31 | sudoku.py 32 | locktest.py 33 | ssltest.py 34 | test.py 35 | utils/reykjanes.py 36 | 37 | # Utility stuff 38 | diskuse.sh 39 | go.sh 40 | goss.sh 41 | parse.sh 42 | process.sh 43 | makezip.sh 44 | gfixmain.sh 45 | nnmain.sh 46 | 47 | # Various resource files 48 | resources/*.txt 49 | !resources/formers.txt 50 | !resources/last.txt 51 | !resources/ordalisti.sorted.txt 52 | !resources/obeygd.hreinsad.txt 53 | resources/*.csv 54 | resources/ord.compressed 55 | mim/ 56 | ifd/ 57 | gold/ 58 | logs/ 59 | .idea/ 60 | .vscode/ 61 | node_modules/ 62 | cffi_test/ 63 | backup/ 64 | 65 | # Vectors directory 66 | vectors/resources/ 67 | vectors/bz2.py 68 | vectors/gensim-0.13.2/ 69 | vectors/numpy-1.11.1/ 70 | vectors/models/ 71 | vectors/t 72 | vectors/test.py 73 | 74 | # Files that are symlinked into the vectors directory 75 | vectors/db 76 | # vectors/settings.py 77 | vectors/similar.py 78 | vectors/Index.conf 79 | 80 | # JavaScript & Node stuff 81 | .eslintrc.js 82 | package-lock.json 83 | package.json 84 | 85 | # Scratch work files 86 | *.bin 87 | *.sublime-project 88 | *.sublime-workspace 89 | *.code-workspace 90 | *.bak 91 | *.profile 92 | *.log 93 | txt 94 | UnknownVerbs.txt 95 | parse.txt 96 | reduce.txt 97 | reduce-dup.txt 98 | input.txt 99 | nohup.out 100 | postfile.txt 101 | 102 | # Distribution / packaging 103 | .Python 104 | env/ 105 | bin/ 106 | build/ 107 | develop-eggs/ 108 | dist/ 109 | eggs/ 110 | lib/ 111 | lib64/ 112 | parts/ 113 | sdist/ 114 | var/ 115 | *.egg-info/ 116 | .installed.cfg 117 | *.egg 118 | log/ 119 | console/ 120 | fonts/ 121 | 122 | # Virtual environments 123 | venv* 124 | p3*/ 125 | p7*/ 126 | pypy/ 127 | pypy* 128 | pypy39/* 129 | pypy310/* 130 | cpython*/ 131 | venv 132 | p312/* 133 | p313/* 134 | p39/* 135 | 136 | # Installer logs 137 | pip-log.txt 138 | pip-delete-this-directory.txt 139 | deploy_done.py 140 | 141 | # Windows image file caches 142 | Thumbs.db 143 | ehthumbs.db 144 | 145 | # Folder config file 146 | Desktop.ini 147 | .DS_Store 148 | 149 | # Recycle Bin used on file shares 150 | $RECYCLE.BIN/ 151 | 152 | # Windows Installer files 153 | *.cab 154 | *.msi 155 | *.msm 156 | *.msp 157 | 158 | # API keys (and other text resources) 159 | resources/* 160 | # Allow the geo folder 161 | !resources/geo/ 162 | 163 | # Ignore audio files generated by speech synthesis 164 | *.mp3 165 | *.wav 166 | *.pcm 167 | *.ogg 168 | *.opus 169 | 170 | # Env file 171 | .env* 172 | 173 | # Coverage test cache 174 | .coverage 175 | 176 | # Ignore files in the query resources folder 177 | queries/resources/* 178 | !queries/resources/.gitkeep 179 | -------------------------------------------------------------------------------- /queries/grammars/geography.grammar: -------------------------------------------------------------------------------- 1 | # Grammar for the geography query module 2 | 3 | Query → 4 | QGeo 5 | 6 | QGeo → QGeoQuery '?'? 7 | 8 | QGeoQuery → 9 | QGeoCapitalQuery 10 | | QGeoCountryQuery 11 | | QGeoContinentQuery 12 | | QGeoLocationDescQuery 13 | 14 | QGeoCapitalQuery → 15 | # "hvað/hver er höfuðborgin í/á Spáni?" 16 | QGeoWhatIs "höfuðborgin" QGeoPreposition QGeoSubject_þgf 17 | # "hvað/hver er höfuðborg Spánar?" 18 | | QGeoWhatIs "höfuðborg" QGeoSubject_ef 19 | # "hvað/hver er höfuðstaður Spánar?" 20 | | QGeoWhatIs "höfuðstaður" QGeoSubject_ef 21 | 22 | QGeoCountryQuery → 23 | "í" "hvaða" "landi" "er" QGeoCityOrTown? QGeoSubject_nf 24 | | "í" "hvaða" "ríki" "er" QGeoCityOrTown? QGeoSubject_nf 25 | 26 | QGeoContinentQuery → 27 | "í" "hvaða" "heimsálfu" "er" QGeoCountryOrCity? QGeoSubject_nf 28 | | "hvar" "í" "heiminum" "er" QGeoCountryOrCity? QGeoSubject_nf 29 | 30 | QGeoLocationDescQuery → 31 | # Hvar er borgin Tókýó / Hvar er landið Kambódía? 32 | QGeoWhereIs QGeoCountryOrCity? QGeoSubject_nf 33 | 34 | QGeoCountryOrCity → 35 | "landið" | "ríkið" | QGeoCityOrTown 36 | 37 | $score(+100) QGeoCountryOrCity 38 | 39 | QGeoCityOrTown → 40 | "borgin" | "bærinn" | "kaupstaðurinn" 41 | 42 | $score(+100) QGeoCityOrTown 43 | 44 | QGeoWhatIs → 45 | "hver" "er" | "hvað" "er" | "hvað" "heitir" | 0 46 | 47 | QGeoWhereIs → 48 | "hvar" "er" 49 | | "hvar" "eru" 50 | | "hvar" "í" "heiminum" "er" 51 | | "hvar" "í" "heiminum" "eru" 52 | | "hvar" "á" "jörðinni" "er" 53 | | "hvar" "á" "jörðinni" "eru" 54 | | "hvar" "á" "plánetunni" "er" 55 | | "hvar" "á" "plánetunni" "eru" 56 | | "hvar" "á" "hnettinum" "er" 57 | | "hvar" "á" "hnettinum" "eru" 58 | 59 | QGeoPreposition → 60 | "í" | "á" 61 | 62 | QGeoSubject/fall → 63 | Nl/fall 64 | 65 | QGeoSubject_nf → 66 | # Hardcoded special case, otherwise identified as adj. "kostaríkur" :) 67 | "kostaríka" 68 | # The grammar seems to have a hard time with these 69 | | "norður" "kórea" 70 | | "nýja" "sjáland" 71 | | "norður" "makedónía" 72 | | "hvíta" "rússland" | "hvíta-rússland" 73 | | "sameinuðu" "arabísku" "furstadæmin" 74 | | "seychelles" "eyjar" 75 | 76 | QGeoSubject_þgf → 77 | # Hardcoded special case, otherwise identified as adj. "kostaríkur" :) 78 | "kostaríku" 79 | | "norður" "kóreu" 80 | | "nýja" "sjálandi" 81 | | "norður" "makedóníu" 82 | | "hvíta" "rússlandi" | "hvíta-rússlandi" 83 | | "sameinuðu" "arabísku" "furstadæmunum" 84 | | "seychelles" "eyjum" 85 | 86 | QGeoSubject_ef → 87 | # Hardcoded special case, otherwise identified as adj. "kostaríkur" :) 88 | "kostaríku" 89 | | "norður" "kóreu" 90 | | "nýja" "sjálands" 91 | | "norður" "makedóníu" 92 | | "hvíta" "rússlands" | "hvíta-rússlands" 93 | | "sameinuðu" "arabísku" "furstadæmanna" 94 | | "seychelles" "eyja" 95 | 96 | $score(+10) QGeoSubject/fall 97 | $score(-100) QGeoLocationDescQuery 98 | 99 | $score(+35) QGeo 100 | -------------------------------------------------------------------------------- /nn/tests.py: -------------------------------------------------------------------------------- 1 | # type: ignore 2 | """ 3 | Greynir: Natural language processing for Icelandic 4 | 5 | Copyright (C) 2023 Miðeind ehf. 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program. If not, see http://www.gnu.org/licenses/. 18 | """ 19 | 20 | from nn.nntree import ( 21 | tokenize_and_merge_possible_mw_tokens, # type: ignore 22 | flat_matching_nonterminal, # type: ignore 23 | flat_is_terminal, # type: ignore 24 | flat_is_nonterminal, # type: ignore 25 | ) 26 | 27 | 28 | def test_merge_person(): 29 | text = "Ingibjörg Sólrún Gísladóttir mun a.m.k. hitta hópinn á morgun" 30 | flat_tree = "P S-MAIN IP NP-SUBJ person_kvk_nf person_kvk_nf person_kvk_nf /NP-SUBJ VP-SEQ VP so_et_fh_gm_nt_p3 ADVP ao /ADVP so_1_þf_gm_nh NP-OBJ no_et_gr_kk_þf /NP-OBJ /VP ADVP ADVP-DATE-REL ao ao /ADVP-DATE-REL /ADVP /VP-SEQ /IP /S-MAIN /P" 31 | text_toks, _ = tokenize_and_merge_possible_mw_tokens(text, flat_tree) 32 | assert len(text_toks) == 6 33 | 34 | 35 | def test_merge_ao(): 36 | text = "Ingibjörg Sólrún Gísladóttir mun a.m.k. hitta hópinn á morgun" 37 | flat_tree = "P S-MAIN IP NP-SUBJ person_kvk_nf no_kvk_nf person_kvk_nf /NP-SUBJ VP-SEQ VP so_et_fh_gm_nt_p3 ADVP ao /ADVP so_1_þf_gm_nh NP-OBJ no_et_gr_kk_þf /NP-OBJ /VP ADVP ADVP-DATE-REL ao ao /ADVP-DATE-REL /ADVP /VP-SEQ /IP /S-MAIN /P" 38 | text_toks, _ = tokenize_and_merge_possible_mw_tokens(text, flat_tree) 39 | assert len(text_toks) == 8 40 | 41 | 42 | def test_no_merge(): 43 | text = "Ingibjörg Sólrún Gísladóttir mun a.m.k. hitta hópinn á morgun" 44 | flat_tree = "P S-MAIN IP NP-SUBJ person_kvk_nf no_kvk_nf person_kvk_nf /NP-SUBJ VP-SEQ VP so_et_fh_gm_nt_p3 ADVP ao /ADVP so_1_þf_gm_nh NP-OBJ no_et_gr_kk_þf /NP-OBJ /VP ADVP ADVP-DATE-REL fs ao /ADVP-DATE-REL /ADVP /VP-SEQ /IP /S-MAIN /P" 45 | text_toks, _ = tokenize_and_merge_possible_mw_tokens(text, flat_tree) 46 | assert len(text_toks) == 9 47 | 48 | 49 | def test_flat_fns(): 50 | nonterms = ["P", "S0", "NP-SUBJ"] 51 | for nt in nonterms: 52 | assert flat_is_nonterminal(nt), "{} should be nonterminal".format(nt) 53 | match = ["/NP-SUBJ", "NP-SUBJ"] 54 | assert flat_matching_nonterminal(match[0]) == match[1], "{} should match {}".format( 55 | *match 56 | ) 57 | assert flat_matching_nonterminal(match[1]) == match[0], "{} should match {}".format( 58 | *match 59 | ) 60 | terms = ["so_1_nf_et_fh_gm_nt_p3", "lo_et_hk_þf", "tö"] 61 | for term in terms: 62 | assert flat_is_terminal(term), "{} should be terminal".format(term) 63 | -------------------------------------------------------------------------------- /queries/whatis.py: -------------------------------------------------------------------------------- 1 | """ 2 | 3 | Greynir: Natural language processing for Icelandic 4 | 5 | 'What is?' query module 6 | 7 | Copyright (C) 2023 Miðeind ehf. 8 | Original author: Vilhjálmur Þorsteinsson 9 | 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program. If not, see http://www.gnu.org/licenses/. 21 | 22 | 23 | This module implements handlers for "What is X?" type queries, 24 | i.e. "Hvað er X?". 25 | 26 | The module is currently disabled. 27 | 28 | """ 29 | 30 | from typing import Set 31 | 32 | from queries import ResponseType, QueryStateDict 33 | from queries.util import read_grammar_file 34 | from tree import Node, ParamList, Result 35 | 36 | # --- Begin "magic" module constants --- 37 | 38 | # The following constants - HANDLE_TREE, PRIORITY and GRAMMAR - 39 | # are "magic"; they are read by query.py to determine how to 40 | # integrate this query module into the server's set of active modules. 41 | 42 | # Indicate that this module wants to handle parse trees for queries 43 | HANDLE_TREE = True 44 | 45 | # Invoke this processor before other tree processors 46 | PRIORITY = 1 47 | 48 | QUERY_NONTERMINALS: Set[str] = set() # { "QWhatIsQuery" } 49 | 50 | GRAMMAR = read_grammar_file("whatis") 51 | 52 | # --- End of "magic" module constants --- 53 | 54 | 55 | def QWhatIsEntity(node: Node, params: ParamList, result: Result) -> None: 56 | result.qtype = "WhatIs" 57 | result.qkey = result._nominative 58 | 59 | 60 | def EfLiður(node: Node, params: ParamList, result: Result) -> None: 61 | """Eignarfallsliðir haldast óbreyttir, 62 | þ.e. þeim á ekki að breyta í nefnifall""" 63 | result._nominative = result._text 64 | 65 | 66 | def FsMeðFallstjórn(node: Node, params: ParamList, result: Result) -> None: 67 | """Forsetningarliðir haldast óbreyttir, 68 | þ.e. þeim á ekki að breyta í nefnifall""" 69 | result._nominative = result._text 70 | 71 | 72 | def sentence(state: QueryStateDict, result: Result) -> None: 73 | """Called when sentence processing is complete""" 74 | q = state["query"] 75 | if "qtype" not in result: 76 | q.set_error("E_QUERY_NOT_UNDERSTOOD") 77 | return 78 | # Successfully matched a query type 79 | q.set_qtype(result.qtype) 80 | q.set_key(result.qkey) 81 | # session = state.get("session") 82 | # Select a query function and exceute it 83 | answer: str = result.qtype + ": " + result.qkey 84 | voice_answer: str = answer 85 | response: ResponseType = dict(answer=answer) 86 | q.set_answer(response, answer, voice_answer) 87 | -------------------------------------------------------------------------------- /scripts/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # deploy.sh 4 | # 5 | # Deployment script for greynir.is 6 | # 7 | # Prompts for confirmation before copying files over 8 | # 9 | # Defaults to deploying to production. 10 | # Run with argument "staging" to deploy to staging 11 | 12 | # set -o errexit # Exit when a command fails 13 | # set -o nounset # Disallow unset variables 14 | # set -o pipefail # Pipeline command fails if any command fails 15 | 16 | SRC=~/github/Greynir 17 | MODE="PRODUCTION" 18 | DEST="/usr/share/nginx/greynir.is" # Production 19 | SERVICE="greynir" 20 | 21 | # Check first argument 22 | if [[ "$1" = "staging" ]]; then 23 | MODE="STAGING" 24 | DEST="/usr/share/nginx/staging.greynir.is" # Staging 25 | SERVICE="staging" 26 | fi 27 | 28 | read -rp "This will deploy Greynir to **${MODE}**. Confirm? (y/n): " CONFIRMED 29 | 30 | if [[ "$CONFIRMED" != "y" ]]; then 31 | echo "Deployment aborted" 32 | exit 1 33 | fi 34 | 35 | echo "Deploying $SRC to $DEST..." 36 | 37 | cd $SRC || exit 1 38 | 39 | cp requirements.txt $DEST/requirements.txt 40 | 41 | cd $DEST || exit 1 42 | 43 | # echo "Upgrading dependencies according to requirements.txt" 44 | 45 | # shellcheck disable=SC1091 46 | source "venv/bin/activate" 47 | pip install --upgrade pip wheel setuptools 48 | pip install --upgrade -r requirements.txt 49 | deactivate 50 | 51 | echo "Removing binary grammar files" 52 | rm venv/site-packages/reynir/Greynir.grammar.bin 53 | rm venv/site-packages/reynir/Greynir.grammar.query.bin 54 | 55 | cd $SRC || exit 1 56 | 57 | echo "Copying files" 58 | 59 | cp config/Index.conf $DEST/config/Index.conf 60 | # Note: config/Greynir.conf is not copied 61 | 62 | cp .env $DEST/.env 63 | cp article.py $DEST/article.py 64 | cp fetcher.py $DEST/fetcher.py 65 | cp geo.py $DEST/geo.py 66 | cp images.py $DEST/images.py 67 | cp main.py $DEST/main.py 68 | cp nertokenizer.py $DEST/nertokenizer.py 69 | cp postagger.py $DEST/postagger.py 70 | cp processor.py $DEST/processor.py 71 | cp scraper.py $DEST/scraper.py 72 | cp search.py $DEST/search.py 73 | cp settings.py $DEST/settings.py 74 | cp similar.py $DEST/similar.py 75 | cp tnttagger.py $DEST/tnttagger.py 76 | cp tts.py $DEST/tts.py 77 | cp utility.py $DEST/utility.py 78 | cp -r db $DEST/ 79 | cp -r routes $DEST/ 80 | cp -r tree $DEST/ 81 | cp scrapers/*.py $DEST/scrapers/ 82 | cp nn/*.py $DEST/nn/ 83 | 84 | # Sync templates, static files and queries 85 | rm -rf queries/__pycache__/ 86 | rsync -av --delete processors/ $DEST/templates/ 87 | rsync -av --delete templates/ $DEST/templates/ 88 | rsync -av --delete static/ $DEST/static/ 89 | rsync -av --delete queries/ $DEST/queries/ 90 | 91 | cp -r resources/geo $DEST/resources/ 92 | 93 | # Put a version identifier (date + commit ID) into the about.html template 94 | ABOUT_TPL="${DEST}/templates/about.html" 95 | sed -i "s/\[Þróunarútgáfa\]/Útgáfa $(date "+%Y-%m-%d %H:%M")/g" "${ABOUT_TPL}" 96 | GITVERS=$(git rev-parse HEAD) # Get git commit ID 97 | GITVERS=${GITVERS:0:7} # Truncate it 98 | sed -i "s/\[Git-útgáfa\]/${GITVERS}/g" "${ABOUT_TPL}" 99 | 100 | echo "Reloading gunicorn server..." 101 | 102 | sudo systemctl reload $SERVICE 103 | 104 | echo "Deployment done" 105 | -------------------------------------------------------------------------------- /queries/grammars/places.grammar: -------------------------------------------------------------------------------- 1 | # Grammar for the places query module 2 | 3 | Query → 4 | QPlaces 5 | 6 | QPlaces → 7 | QPlacesQuery '?'? 8 | 9 | QPlacesQuery → 10 | QPlacesOpeningHoursNow | QPlacesIsOpen | QPlacesIsClosed | QPlacesAddress 11 | 12 | QPlacesOpeningHoursNow → 13 | QPlacesOpeningHours QPlToday? 14 | 15 | QPlacesOpeningHours → 16 | "hvað" "er" "opið" "lengi" QPlacesPrepAndSubject 17 | | "hvað" "er" "lengi" "opið" QPlacesPrepAndSubject 18 | | "hverjir" "eru" "opnunartímar" QPlacesPrepAndSubject 19 | | "hverjir" "eru" "opnunartímar" QPlacesSubject_ef 20 | | "hvaða" "opnunartímar" "eru" QPlacesPrepAndSubject 21 | | "hversu" "lengi" "er" "opið" QPlacesPrepAndSubject 22 | | "hve" "lengi" "er" "opið" QPlacesPrepAndSubject 23 | | "klukkan" "hvað" "opnar" QPlacesPrepAndSubject 24 | | "klukkan" "hvað" "opnar" QPlacesSubject_nf 25 | | "hvenær" "lokar" QPlacesPrepAndSubject 26 | | "hvenær" "lokar" QPlacesSubject_nf 27 | | "hvenær" "opnar" QPlacesPrepAndSubject 28 | | "hvenær" "opnar" QPlacesSubject_nf 29 | | "klukkan" "hvað" "lokar" QPlacesPrepAndSubject 30 | | "klukkan" "hvað" "lokar" QPlacesSubject_nf 31 | | "hversu" "langt" "er" "í" "lokun" QPlacesPrepAndSubject 32 | | "hversu" "langt" "er" "í" "lokun" QPlacesSubject_ef 33 | | "hvað" "er" "langt" "í" "lokun" QPlacesPrepAndSubject 34 | | "hvað" "er" "langt" "í" "lokun" QPlacesSubject_ef 35 | | "hvenær" "er" "opið" QPlacesPrepAndSubject 36 | | "hvað" "er" QPlacesSubject_nf QPlOpen "lengi" 37 | | "hve" "lengi" "er" QPlacesSubject_nf QPlOpen 38 | | "hversu" "lengi" "er" QPlacesSubject_nf QPlOpen 39 | | "hvenær" "er" QPlacesSubject_nf QPlOpen 40 | 41 | QPlacesIsOpen → 42 | "er"? "opið" QPlacesPrepAndSubject QPlNow? 43 | | "er"? QPlacesSubject_nf QPlOpen QPlNow? 44 | 45 | QPlacesIsClosed → 46 | "er"? "lokað" QPlacesPrepAndSubject QPlNow? 47 | | "er"? QPlacesSubject_nf QPlClosed QPlNow? 48 | 49 | QPlacesWhatIs → 50 | "hvert" "er" | "hvað" "er" 51 | 52 | QPlacesAddress → 53 | QPlacesWhatIs? "heimilisfangið" QPlacesPrepAndSubject 54 | | QPlacesWhatIs? "heimilisfang" QPlacesSubject_ef 55 | | "hvar" "er" QPlacesSubject_nf "til" "húsa" 56 | | "hvar" "er" QPlacesSubject_nf "staðsett" 57 | | "hvar" "er" QPlacesSubject_nf "staðsettur" 58 | | QPlacesPreposition "hvaða" "götu" "er" QPlacesSubject_nf 59 | | QPlacesPreposition "hvaða" "stræti" "er" QPlacesSubject_nf 60 | 61 | QPlacesPrepAndSubject → 62 | QPlacesPrepWithÞgf QPlacesSubject_þgf 63 | | QPlacesPrepWithÞf QPlacesSubject_þf 64 | 65 | QPlacesSubject/fall → 66 | Nl/fall 67 | 68 | $tag(keep) QPlacesSubject/fall 69 | 70 | QPlacesPreposition → 71 | QPlacesPrepWithÞf | QPlacesPrepWithÞgf 72 | 73 | QPlacesPrepWithÞgf → 74 | "á" | "í" | "hjá" 75 | 76 | QPlacesPrepWithÞf → 77 | "við" | "fyrir" 78 | 79 | QPlOpen → 80 | "opið" | "opin" | "opinn" 81 | 82 | QPlClosed → 83 | "lokað" | "lokuð" | "lokaður" 84 | 85 | QPlNow → 86 | "núna" | "í" "augnablikinu" | "eins" "og" "stendur" | "nú" 87 | 88 | QPlToday → 89 | "núna"? "í" "dag" | "núna"? "í_kvöld" # | "núna"? 'í_dag' 90 | 91 | QPlacesCloseBy → 92 | "í" "grenndinni" | "nálægt" "mér"? | "nálægt" "okkur" 93 | 94 | $score(+35) QPlacesQuery 95 | -------------------------------------------------------------------------------- /docs/setup_macos.md: -------------------------------------------------------------------------------- 1 | # Greynir - Setup instructions for macOS 2 | 3 | These instructions are for macOS 10.12 or later. 4 | 5 | ## Install dependencies 6 | 7 | Using [Homebrew](https://brew.sh): 8 | 9 | ```bash 10 | brew install python3 pypy3 postgresql ossp-uuid 11 | ``` 12 | 13 | Alternatively, you can install these packages manually: 14 | 15 | * [Python 3](https://www.python.org/downloads/mac-osx/) 16 | * [PyPy 3.9](https://pypy.org/download.html) 17 | * [PostgreSQL](https://www.postgresql.org/download/macosx/) 18 | * [uuid-ossp module](https://www.postgresql.org/docs/devel/uuid-ossp.html) 19 | 20 | ## Set up Python virtualenv 21 | 22 | Make sure pip and virtualenv are up to date: 23 | 24 | ```bash 25 | pip3 install --upgrade pip 26 | pip3 install --upgrade virtualenv 27 | ``` 28 | 29 | Check out source code using [git](https://git-scm.com): 30 | 31 | ```bash 32 | cd ~ 33 | git clone https://github.com/mideind/Greynir 34 | cd ~/Greynir 35 | ``` 36 | 37 | Create and activate virtual environment, install required Python packages: 38 | 39 | ```bash 40 | virtualenv -p /usr/local/bin/pypy3 venv 41 | source venv/bin/activate 42 | pip install -r requirements.txt 43 | ``` 44 | 45 | ## Set up database 46 | 47 | Connect to [PostgreSQL](https://www.postgresql.org) database: 48 | 49 | ```bash 50 | psql 51 | ``` 52 | 53 | Create user (replace *your_name* with your username): 54 | 55 | ```postgresql 56 | create user reynir with password 'reynir'; 57 | create user your_name; 58 | alter role your_name with superuser; 59 | ``` 60 | 61 | Create database: 62 | 63 | ```postgresql 64 | create database scraper with encoding 'UTF8' LC_COLLATE='is_IS.UTF-8' LC_CTYPE='is_IS.UTF-8' TEMPLATE=template0; 65 | ``` 66 | 67 | Enable uuid extension: 68 | 69 | ```postgresql 70 | \c scraper 71 | create extension if not exists "uuid-ossp"; 72 | ``` 73 | 74 | Verify that the uuid extension is enabled: 75 | 76 | ```postgresql 77 | select * from pg_extension; 78 | ``` 79 | 80 | and then `\q` to quit the postgres client. 81 | 82 | Finally, create the database tables used by Greynir (this will only create 83 | the tables if needed, and no existing data is erased): 84 | 85 | ```bash 86 | cd ~/Greynir 87 | python scraper.py --init 88 | ``` 89 | 90 | ## Run 91 | 92 | Change to the Greynir repo directory and activate the virtual environment: 93 | 94 | ```bash 95 | cd ~/Greynir 96 | source venv/bin/activate 97 | ``` 98 | 99 | #### Web application 100 | 101 | Defaults to running on [`localhost:5000`](http://localhost:5000) but this 102 | can be changed in `config/Greynir.conf`. 103 | 104 | ```bash 105 | python main.py 106 | ``` 107 | 108 | #### Scrapers 109 | 110 | ```bash 111 | python scraper.py 112 | ``` 113 | 114 | NB: Due to issues with Python's `fork()` in recent versions of macOS, you 115 | may need to run the following shell command in order for scraping to work: 116 | 117 | ```bash 118 | export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES 119 | ``` 120 | 121 | #### Interactive shell 122 | 123 | ```bash 124 | ./shell.sh 125 | ``` 126 | 127 | Starts an [IPython](https://ipython.org) shell with a database session (`s`), 128 | the Greynir parser (`r`) and all SQLAlchemy database models preloaded. For 129 | more info, see [Using the Greynir Shell](shell.md). 130 | -------------------------------------------------------------------------------- /tools/dbclean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # type: ignore 3 | """ 4 | 5 | Greynir: Natural language processing for Icelandic 6 | 7 | Copyright (C) 2023 Miðeind ehf. 8 | 9 | This program is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program. If not, see http://www.gnu.org/licenses/. 20 | 21 | 22 | Utility script that inspects articles in Greynir's database 23 | and removes those that: 24 | 25 | * Don't contain any sentences 26 | * Are duplicates (e.g. https vs http URLs) 27 | * Are non-Icelandic 28 | * Contain lots of "chaff", i.e. many very short sentences (prob. scraper issues) 29 | 30 | """ 31 | 32 | import os 33 | import sys 34 | import re 35 | from random import shuffle 36 | 37 | # Hack to make this Python program executable from the tools subdirectory 38 | basepath, _ = os.path.split(os.path.realpath(__file__)) 39 | _TOOLS = os.sep + "tools" 40 | if basepath.endswith(_TOOLS): 41 | basepath = basepath[0 : -len(_TOOLS)] 42 | sys.path.append(basepath) 43 | 44 | from settings import Settings, ConfigError 45 | 46 | # from article import Article 47 | from db import SessionContext 48 | from db.models import Article as ArticleModel 49 | 50 | from reynir.bintokenizer import tokens_are_foreign 51 | 52 | 53 | def main(): 54 | 55 | try: 56 | # Read configuration file 57 | Settings.read(os.path.join(basepath, "config", "GreynirSimple.conf")) 58 | except ConfigError as e: 59 | print("Configuration error: {0}".format(e)) 60 | quit() 61 | 62 | with SessionContext(commit=True) as session: 63 | 64 | # Zero sentences 65 | print("Deleting all articles with zero sentences") 66 | res = session.execute( 67 | ArticleModel.table().delete().where(ArticleModel.num_sentences == 0) 68 | ) 69 | print(str(res.rowcount) + " articles deleted") 70 | 71 | # Non-Icelandic 72 | # TODO: Implement me! 73 | 74 | # Duplicates 75 | # For each https article, check whether there is a corresponding 76 | # article URL with http URI scheme 77 | dupl = 0 78 | q = session.query(ArticleModel.url).filter(ArticleModel.url.like("https://%")) 79 | for r in q.all(): 80 | url = re.sub(r"^https://", r"http://", r.url) 81 | # c = session.query(ArticleModel.url).filter(ArticleModel.url == url).count() 82 | res = session.execute( 83 | ArticleModel.table().delete().where(ArticleModel.url == url) 84 | ) 85 | dupl += res.rowcount 86 | print("{0} duplicate URLs w. HTTP scheme removed".format(dupl)) 87 | 88 | # Chaff 89 | # ??? 90 | # TODO: Implement me! 91 | 92 | 93 | if __name__ == "__main__": 94 | main() 95 | -------------------------------------------------------------------------------- /templates/people/recent.html: -------------------------------------------------------------------------------- 1 | 2 | {% extends "container-normal.html" %} 3 | 4 | {% block styles %} 5 | 6 | 7 | 8 | {% endblock %} 9 | 10 | {% block content %} 11 | 12 || Kyn | 50 |Nafn | 51 |Titill | 52 | 53 | 54 | {% for person in persons %} 55 |||||
|---|---|---|---|---|---|---|
| 58 | | {{ person.name }} | 59 | {% elif person.gender == 'kvk' %} 60 |61 | | {{ person.name }} | 62 | {% else %} 63 |64 | | {{ person.name }} | 65 | {% endif %} 66 |{{ person.title }} | 67 |