hunk ./cronfa-generic.lisp 503 - ("key" . ,(substitute #\u #\ù w)))) + ("key" . ,(substitute #\n #\ñ w)))) hunk ./cronfa-generic.lisp 93 +(defparameter *c5k* 0.0) +(defparameter *c30k* 0.0) hunk ./cronfa-generic.lisp 189 -~,2f%" (/ *r5k* 50.0) (/ *r30k* 300.0)) +~,2f% +Cymraeg → Русский~,2f% +~,2f%" (/ *r5k* 50.0) (/ *r30k* 300.0) +(/ *c5k* 50.0) (/ *c30k* 300.0)) hunk ./cronfa-pg.lisp 131 + (setf *c5k* (caar (db-ask "select count(*) from cf where num<5001 and exists (select 1 from p, s where p.first=rf.id and p.second=s.id and s.lang=0)"))) + (setf *c30k* (caar (db-ask "select count(*) from cf where num<30001 and exists (select 1 from p, s where p.first=rf.id and p.second=s.id and s.lang=0)"))) hunk ./cronfa-pg.lisp 131 - (setf *c5k* (caar (db-ask "select count(*) from cf where num<5001 and exists (select 1 from p, s where p.first=rf.id and p.second=s.id and s.lang=0)"))) - (setf *c30k* (caar (db-ask "select count(*) from cf where num<30001 and exists (select 1 from p, s where p.first=rf.id and p.second=s.id and s.lang=0)"))) + (setf *c5k* (caar (db-ask "select count(*) from cf where num<5001 and exists (select 1 from p, s where p.first=cf.id and p.second=s.id and s.lang=0)"))) + (setf *c30k* (caar (db-ask "select count(*) from cf where num<30001 and exists (select 1 from p, s where p.first=cf.id and p.second=s.id and s.lang=0)"))) hunk ./aranrod.lisp 158 -(defun welsh-pron (str) - (format - nil "http://www.bbc.co.uk/wales/learnwelsh/media/dict/~{~a~}.ram" - (map 'list - (lambda (c) - (string - (case c - (#\â "acirc") (#\ê "ecirc") (#\î "icirc") (#\ô "ocirc") - (#\û "ucirc") (#\ŵ "wcirc") (#\ŷ "ycirc") (t c)))) - str))) - -(defun irish-pron (str) - (format nil "http://www.csis.ul.ie/focloir/sounds/~a.wav" str)) - -(defparameter +prons+ '((1 . welsh-pron) (3 . irish-pron))) - -(defun pronunciation (lang str) - (let ((func (cdr (assoc lang +prons+)))) - (if func `(((a :href ,(funcall func str)) "♪"))))) - hunk ./aranrod.lisp 174 - ,@(pronunciation (second w) (fourth w)) hunk ./geiriadur-steel.asd 6 - :depends-on (geiriadur cl-ppcre drakma closure-html cxml-stp) + :depends-on (geiriadur cl-ppcre drakma closure-html cxml-stp split-sequence) hunk ./geiriadur.asd 7 - +; and in Clozure CL since 1.7 :( +#| hunk ./geiriadur.asd 39 - +|# hunk ./geiriadur.asd 51 +#| hunk ./geiriadur.asd 55 +|# + (:file "dictionary-ss") hunk ./lladrata.lisp 466 + +(defun local-name (c) (when (eq 'stp:element (type-of c)) (stp:local-name c))) + +(defun delete-by-name (name c) + (stp:delete-child name c :test #'string-equal :key #'local-name)) + +(defun irish (&optional (word "Aidbhint")) + (let ((body + (stp:nth-child + 1 ; body + (stp:first-child ; html + (chtml:parse + (remove + #\Lf + (remove + #\Cr + (drakma:http-request + "http://193.1.97.44/scripts/focweb/Exe/focloir.exe" + :parameters + `(("VERBFORM" . "Dearfach") ("LANGUAGE" . "gaeilge") + ("WORD" . ,word)) + :method :post))) + (stp:make-builder)))))) + (assert (= 9 (stp:number-of-children body))) + (let* ((dl (stp:nth-child 3 body)) + (next nil) + (len (or + (stp:child-position-if + #'(lambda (c) + (and (eq 'stp:text (type-of (stp:first-child c))) + (or + (eql 0 (search "Is foirm de" + (stp-data (stp:first-child c)))) + (eql 0 (search "Tagann" + (stp-data (stp:first-child c)))) + (eql 0 (search "Níl an focal faighte" + (stp-data (stp:first-child c))))))) + dl) + (stp:number-of-children dl)))) + (when (> len 1) + (assert (equal "dt" (local-name (stp:first-child dl)))) + (do ((1st 0 2nd) + (2nd (or (stp:child-position-if + #'(lambda (c) (equal "dt" (local-name c))) + dl :start 1 :end len) len) + (or (when (> len 2nd) + (stp:child-position-if + #'(lambda (c) (equal "dt" (local-name c))) + dl :start (1+ 2nd) :end len)) len))) + ((= 1st len)) + (let ((dt (stp:nth-child (+ 0 1st) dl))) + (delete-by-name "a" dt) + (stp:delete-child-if + #'(lambda (c) (and (eq 'stp:text (type-of c)) + (zerop + (length (string-trim " " (stp-data c)))))) + dt) + (cond + ((= 2 (stp:number-of-children dt)) + (format t "~a ~a~%" + (stp:data (stp:first-child (stp:nth-child 0 dt))) + (stp:data (stp:nth-child 1 dt)))) + ((and (= 1 (stp:number-of-children dt)) + (eq 'stp:text (type-of (stp:first-child + (stp:nth-child (+ 1 1st) dl)))) + (or (eql 0 (search "=" + (stp-data + (stp:first-child + (stp:nth-child (+ 1 1st) dl))))) + (eql 0 (search "faoi" + (stp-data + (stp:first-child + (stp:nth-child (+ 1 1st) dl))))))) + nil) + (t (assert (= 2 (stp:number-of-children dt))))) + (loop for i from (+ 1 1st) below 2nd do + (assert (equal "dd" (local-name (stp:nth-child i dl))))) + ; может не быть определения? + (let* ((fn (if (and (< 1 (stp:number-of-children + (stp:nth-child (+ 1 1st) dl))) + (equal "form" + (local-name + (stp:nth-child + 1 + (stp:nth-child (+ 1 1st) dl))))) + (+ 1 1st) + (+ 2 1st))) + (form (stp:nth-child 1 (stp:nth-child fn dl)))) + (assert (= 5 (stp:number-of-children form))) + (setf next + (string-trim + " " + (stp:attribute-value (stp:last-child form) "value")))))) + (when (< len (stp:number-of-children dl)) + (format t "~tIs foirm de~%"))) + ;baininscneach = Fem. + ;firinscneach = Masc. + ;chéad, dara, tríú, cheathrú díochlaonadh = Decl.1,2,3,4 + (when (null next) + (cond + ((string= word "caidhne") (setf next "caidhp")) + ((string= word "comaoineach") (setf next "comard")) + ((string= word "croisíní") (setf next "croite")) + ((string= word "críostaí") (setf next "críostúil")) + ((string= word "díorthach") (setf next "díorthú")) + ((string= word "grafadh") (setf next "grafán")) + ((string= word "gríobhán") (setf next "gríos")) + ;((string= word "gríodán") (setf next "gríos")) + ((string= word "guine") (setf next "guiséad")) + ((string= word "gáirí") (setf next "gáitéar")) + ((string= word "gúshnath") (setf next "gúta")) + ((string= word "ina") (setf next "inbhear")) + ((string= word "inár") (setf next "iníoctha")) + ((string= word "lena") (setf next "leochaileach")) + ((string= word "lúipin") (setf next "lúircín")) + ((string= word "máistreás") (setf next "máistriúil")) + ((string= word "neamhdhlisteanach") (setf next "neamhdhuine")) + ((string= word "spéirbhean") (setf next "spéireata")) + ((string= word "stráisiun") (setf next "stríoc")) + ((string= word "séipéilin") (setf next "séire")) + ((string= word "uaibhéallacht") (setf next "uaiféalta")) + ((string= word "ule") (setf next "ullamh")) + ((string= word "ín") (setf next "íobairt")) + ((string= word "óráid") (setf next "óráidí")) + (t (error "Níl")))) + (when (string= word next) + (cond + ((string= next "ais-") (setf next "ais")) + ((string= next "don") (setf next "dona")) + ((string= next "dé") (setf next "déach")) + ((string= next "glinne") (setf next "glinniúint")) + ((string= next "lúide") (setf next "lúidín")) + ((string= next "plás") (setf next "plástar")) + ((string= next "raibh") (setf next "raibí")) + ((string= next "túis") (setf next "túisce")) + ((string= next "úth") (setf next nil)) + (t (error next)))) + next))) + +(defun gwyddeleg (&optional (word "Aidbhint")) + (when word (gwyddeleg (irish word)))) + +(defun irish1 (&optional (word "Aidbhint")) + (let ((body + (stp:nth-child + 1 ; body + (stp:first-child ; html + (chtml:parse + (remove + #\Lf + (remove + #\Cr + (drakma:http-request + "http://193.1.97.44/scripts/focweb/Exe/focloir.exe" + :parameters + `(("VERBFORM" . "Dearfach") ("LANGUAGE" . "gaeilge") + ("WORD" . ,word)) + :method :post))) + (stp:make-builder)))))) + (assert (= 9 (stp:number-of-children body))) + (let ((dl (stp:nth-child 3 body))) + dl)))