Skip to content

Commit

Permalink
Forgot the init files.
Browse files Browse the repository at this point in the history
  • Loading branch information
remivantrijp committed May 17, 2021
1 parent 317a493 commit 4f36202
Show file tree
Hide file tree
Showing 4 changed files with 189 additions and 0 deletions.
68 changes: 68 additions & 0 deletions init-english.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at

;; http://www.apache.org/licenses/LICENSE-2.0

;; Unless required by applicable law or agreed to in writing, software
;; distributed under the License is distributed on an "AS IS" BASIS,
;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;; See the License for the specific language governing permissions and
;; limitations under the License.
;;=========================================================================

(in-package :fcg-server)


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Load system for the grammar ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(asdf:operate 'asdf:load-op :english-grammar)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Add pointer to cxn-inventory ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Here, you should add a pointer to a folder containing static html for your cxn-inventory
;; You can make it with the function make-html-cxn-inventory-for-fcg-interactive , e.g.
;; (fcg::make-html-cxn-inventory-for-fcg-interactive fcg::*fcg-constructions* :hide-labels '(fcg::lex fcg::lex2 fcg::marked-morph fcg::zero-morph))
;; Then put it somewhere /var/www/wordpress/FCG/cxn-inventories - or talk to paul

(pushnew '("*fcg-constructions*" . "cxn-inventories/fcg-constructions/") *links-cxn-inv*)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Add pointer to examples ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Here you should add links to text files containing example sentences/meanings

(push (cons "*fcg-constructions*" (fcg-server::read-example-sentences
(babel-pathname :directory '("grammars" "English" "example-sentences") :name "sentences" :type "txt")))
fcg-server::*example-sentences*)

(push (cons "*fcg-constructions*" (fcg-server::read-example-meanings
(babel-pathname :directory '("grammars" "English" "example-sentences") :name "meanings" :type "txt")))
fcg-server::*example-meanings*)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Add pointer to reference text ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(let ((reference-text
(string-append (render-xml '((div :class "ref_web_demo")((p)"English Grammar by Remi van Trijp")))
(render-xml '((div :class "ref_supporting_publications")
((p) "Supporting publications:")
((ul)
((li)"van Trijp, R. 2017. A Computational Construction Grammar for English. The AAAI 2017 Spring Symposium on Computational Construction Grammar and Natural Language Understanding. Technical Report SS-17-02.")))))))
(push `("*fcg-constructions*" . ,reference-text) *reference-texts*))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Grammar-specific code ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Here you can add any code that you want to execute on the startup of your grammar.
;; (you might want to switch to your a different package here)



64 changes: 64 additions & 0 deletions init-portuguese.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
(in-package :fcg-server)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Load system for the grammar ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(asdf:operate 'asdf:load-op 'portuguese-grammar)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Add pointer to cxn-inventory ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Here, you should add a pointer to a folder containing static html for your cxn-inventory
;; You can make it with the function make-html-cxn-inventory-for-fcg-interactive , e.g.
;; (fcg::make-html-cxn-inventory-for-fcg-interactive fcg::*portuguese-corpus-grammar* :hide-labels '(fcg::morph fcg::lex))
;; Then put it somewhere /var/www/wordpress/FCG/cxn-inventories - or talk to paul

(pushnew '("*portuguese-corpus-grammar*" . "cxn-inventories/portuguese-corpus-grammar/") *links-cxn-inv*)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Add pointer to examples ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Here you should add links to text files containing example sentences/meanings

(push (cons "*portuguese-corpus-grammar*" (read-example-sentences
(babel-pathname :directory '("grammars" "Portuguese")
:name "correct-sentences" :type "txt")))
*example-sentences*)

(push (cons "*portuguese-corpus-grammar*" (read-example-meanings
(babel-pathname :directory '("grammars" "Portuguese")
:name "correct-meanings" :type "txt")))
*example-meanings*)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Add pointer to reference text ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(let ((reference-text
(string-append (render-xml '((div :class "ref_web_demo")((p)"For a documented web demonstration supporting this grammar, click "
((a :href "https://www.fcg-net.org/demos/propor-2016") "here."))))
(render-xml '((div :class "ref_supporting_publications")
((p) "Supporting publications:")
((ul)
((li)"Marques, Tânia & Beuls, Katrien. (2016). A Construction Grammar Approach for Pronominal Clitics in European Portuguese. Computational Processing of the Portuguese Language (PROPOR 2016).")
((li)"Marques, Tânia & Beuls, Katrien. (2016). Evaluation Strategies for Computational Construction Grammars.The 26th International Conference on Computational Linguistics (COLING 2016).")))))))
(push `("*portuguese-corpus-grammar*" . ,reference-text) *reference-texts*))


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Grammar-specific code ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Here you can add any code that you want to execute on the startup of your grammar.
;; (you might want to switch to your a different package here)

(in-package :fcg)

(defparameter *portuguese-corpus-grammar* (create-grammar))



56 changes: 56 additions & 0 deletions init-russian.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
(in-package :fcg-server)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Load system for the grammar ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(asdf:operate 'asdf:load-op 'fcg)
(load (babel-pathname :directory '("grammars" "Russian") :name "motion-verbs" :type "lisp"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Add pointer to cxn-inventory ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Here, you should add a pointer to a folder containing static html for your cxn-inventory
;; You can make it with the function make-html-cxn-inventory-for-fcg-interactive , e.g.
;; (fcg::make-html-cxn-inventory-for-fcg-interactive fcg::*portuguese-corpus-grammar* :hide-labels '(fcg::morph fcg::lex))
;; Then put it somewhere /var/www/wordpress/FCG/cxn-inventories - or talk to paul

(pushnew '("*russian-motion-grammar*" . "cxn-inventories/russian-motion-grammar/") *links-cxn-inv*)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Add pointer to examples ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Here you should add links to text files containing example sentences/meanings

(push (cons "*russian-motion-grammar*" (read-example-sentences
(babel-pathname :directory '("grammars" "Russian")
:name "example-sentences" :type "txt")))
*example-sentences*)

(push (cons "*russian-motion-grammar*" (read-example-meanings
(babel-pathname :directory '("grammars" "Russian")
:name "example-meanings" :type "txt")))
*example-meanings*)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Add pointer to reference text ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(let ((reference-text (string-append
(render-xml '((div :class "ref_web_demo")
((p)"For a documented web demonstration supporting this grammar, click "
((a :href "https://www.fcg-net.org/demos/russian-motion-verbs") "here."))))
(render-xml '((div :class "ref_supporting_publications")
((p) "Supporting publication:")
((ul)
((li)"Knight, Yana; Beuls, Katrien and Michael Spranger. (Accepted). Russian Verbs of Motion and their Aspectual Partners in Fluid Construction Grammar. Constructions and Frames.")))))))
(push `("*russian-motion-grammar*" . ,reference-text) *reference-texts*))


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Grammar-specific code ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Here you can add any code that you want to execute on the startup of your grammar.
;; (you might want to switch to your a different package here)
1 change: 1 addition & 0 deletions server-interface/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.xfasl

0 comments on commit 4f36202

Please sign in to comment.