-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make a NL-specific language model (2nd person pronoun copied from the…
… ES-specific english language model)
- Loading branch information
Showing
6 changed files
with
293 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
[{:rule :pronouns-2p | ||
:if {:canonical "you"} | ||
:then [{:agr {:number :sing} | ||
:case :nom | ||
:sense 1 | ||
:note [:informal :singular] | ||
:sem {:ref {:context :informal}}} | ||
|
||
{:agr {:gender :masc | ||
:number :plur} | ||
:sense 2 | ||
:case :nom | ||
:note [:informal :masculine :plural] | ||
:sem {:ref {:context :informal}}} | ||
|
||
{:agr {:gender :fem | ||
:number :plur} | ||
:case :nom | ||
:sense 3 | ||
:note [:informal :feminine :plural] | ||
:sem {:ref {:context :informal} | ||
:person-not :1st}} | ||
|
||
{:agr {:number :sing} | ||
:case :nom | ||
:sense 4 | ||
:note [:formal :singular] | ||
:sem {:ref {:context :formal}}} | ||
|
||
{:agr {:number :plur} | ||
:case :nom | ||
:sense 5 | ||
:note [:formal :plural] | ||
:sem {:ref {:context :formal}}} | ||
|
||
{:agr {:number :sing} | ||
:case :acc | ||
:sense 6 | ||
:note [:informal :singular] | ||
:sem {:ref {:context :informal} | ||
:person-not :1st}} | ||
|
||
{:agr {:number :plur} | ||
:case :acc | ||
:sense 7 | ||
:note [:informal :plural] | ||
:sem {:ref {:context :informal} | ||
:person-not :1st}} | ||
|
||
{:agr {:number :sing} | ||
:sense 8 | ||
:case :acc | ||
:note [:formal :singular] | ||
:sem {:ref {:context :formal} | ||
:person-not :1st}} | ||
|
||
{:agr {:person :2nd | ||
:number :plur} | ||
:sense 9 | ||
:case :acc | ||
:note [:formal :plural] | ||
:sem {:ref {:context :formal} | ||
:person-not :1st}}]}] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{:name "complete" | ||
:language "en" | ||
:morphology {:path "english/morphology" | ||
:sources ["misc.edn" | ||
"nouns.edn" | ||
"verbs.edn"]} | ||
:grammar "english/grammar.edn" | ||
:lexicon {:path "english/lexicon" | ||
:rules ["rules.edn" "rules/nl.edn"] | ||
:sources {"adjectives.edn" {:u {:cat :adjective}} | ||
"adverbs.edn" {:u {:cat :adverb}} | ||
"exclamations.edn" {:u {:cat :exclamation}} | ||
"intensifiers.edn" {:u {:cat :intensifier}} | ||
"misc.edn" {:u {}} | ||
"nouns.edn" {:u {:cat :noun}} | ||
"numbers.edn" {:u {:cat :adjective | ||
:sem {:number? true}}} | ||
"pronouns.edn" {:u {:cat :noun | ||
:pronoun? true | ||
:propernoun? false}} | ||
"propernouns.edn" {:u {:cat :noun | ||
:propernoun? true | ||
:pronoun? false}} | ||
"verbs.edn" {:u {:cat :verb}}}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
(ns menard.english.nl | ||
(:require [dag_unify.core :as u] | ||
[clojure.tools.logging :as log] | ||
[menard.english :as en] | ||
[menard.english.compile :refer [compile-lexicon]] | ||
[menard.model :refer [create]])) | ||
|
||
(def model | ||
(delay (create "english/models/nl" | ||
"complete" | ||
compile-lexicon false {:include-derivation? false}))) | ||
|
||
(defn analyze [surface] | ||
(en/analyze surface @model)) | ||
|
||
(defn generate [spec] | ||
(en/generate spec @model)) | ||
|
||
(defn morph [expression] | ||
(en/morph expression @model false)) | ||
|
||
(defn parse [surface] | ||
(en/parse surface @model)) | ||
|
||
(defn syntax-tree [tree] | ||
(en/syntax-tree tree @model)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.