{"id":22155904,"url":"https://github.com/citiususc/deppattern","last_synced_at":"2025-07-26T07:32:32.331Z","repository":{"id":68812552,"uuid":"103631820","full_name":"citiususc/DepPattern","owner":"citiususc","description":"Dependency syntactic parser and formal grammar for Natural Languages","archived":false,"fork":false,"pushed_at":"2024-04-29T15:35:05.000Z","size":87514,"stargazers_count":11,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-29T16:51:26.104Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/citiususc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-15T08:10:13.000Z","updated_at":"2024-04-29T15:35:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"6a478d46-2d84-4d2a-94e0-bb6d22542e0e","html_url":"https://github.com/citiususc/DepPattern","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/citiususc%2FDepPattern","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/citiususc%2FDepPattern/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/citiususc%2FDepPattern/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/citiususc%2FDepPattern/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/citiususc","download_url":"https://codeload.github.com/citiususc/DepPattern/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227660697,"owners_count":17800409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-02T02:32:56.339Z","updated_at":"2024-12-02T02:32:57.502Z","avatar_url":"https://github.com/citiususc.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DepPattern parsers and grammar compiler\n\n## DESCRIPTION\nThis software contains four rule-based, dependency-based syntactic parsers for 4 languages (English, Spanish, Galician, and Portuguese), as well as MetaRomance, a multilingual parser suited for Romance languages. The parsers were implemented in PERL and are stored in the `parsers` folder. They were generated from dependency grammars, stored in the `grammars` folder. \n\nThe software also contains a compiler (compi-beta.rb), implemented in Ruby, which generate parsers in PERL from DepPattern grammars. To write formal grammars using DepPattern, please, look up the [tutorial of the formal grammar](http://gramatica.usc.es/pln/tools/deppattern/html_tutorial/tutorialGrammar.html). \nBesides, the software provides the PoS tagger of [Linguakit](https://github.com/citiususc/Linguakit), also developed by our group.\n\n\n## REQUIREMENTS\nGNU/LINUX, Perl and Ruby (for the grammar compiler) \n\n\n## HOW TO INSTALL\nYou only need to download the repository.\n\n### ZIP Download\n\nDownload [DepPattern-master.zip](https://github.com/citiususc/DepPattern/archive/master.zip) and then: \n\n```bash\nunzip DepPattern-master.zip\n```\n\n### Using Git\n\n```bash\ngit clone https://github.com/citiususc/DepPattern.git\n```\n\n## HOW TO USE\nRun `./deppattern --help` to see the modules:\n\n```\nusage: deppattern \u003clang\u003e [--help|-h] [-m|--meta-romance] [-g|--grammar] \n       \t\t  \t [-ng|--no-iteration-grammar] [-p|--parser] [-f|--file] [-a] [-fa] [-c]\n\nrequired positional arguments:\n  \u003clang\u003e          Choose the language \n\t\t  Choices: [en, es, gl, pt], case insensitive\n\noptional named arguments:\n  --help, -h                               ? show this help message and exit\n  -m, --meta-romance                       ? MetaRomance Parser\n  -g, --grammar \u003cgrammar\u003e                  ? Path of the file grammar (with iterations)\n  -ng, --no-iteration-grammar \u003cgrammar\u003e    ? Path of the file grammar (without iterations)\n  -p, --parser \u003cparser\u003e                    ? Path of the parser, or name of the parser generated from grammar (i.e. metaromance)\n  -f, --file \u003cfile\u003e                        ? Path of the file input (default stdin)\n  -a                                       ? Simple dependency analysis\n  -fa                                      ? Full dependency analysis\n  -conll                                   ? Full dependency analysis with CoNLL format\n  -c                                       ? Tagged text with syntactic information (for correction rules)\n```\n\n## HOW TO USE IN WINDOWS\n\nThe same syntax with `deppattern.bat` command. You must install Perl and Ruby for Windows and specify the paths for the corresponding interperters: perl and ruby.\n\n\n## EXAMPLES\n\nReturn a syntactic analysis for Portuguese in -a format:\n```\n./deppattern pt -f tests/test-pt -a\n```\n\nReturn a syntactic analysis for English in -conll format:\n```\n./deppattern en -f tests/test-en -conll\n```\n\nGenerate a parser (parser.perl) from the English grammar using the compiler:\n\n```\n./deppattern en -g grammars/grammar-devel-en/grammar-en.dp`\n```\n\nReturn a syntactic analysis using the Spanish grammar, with -conll format:\n\n```\n./deppattern en -f tests/test-es -g grammars/grammar-devel-es/grammar-es.dp -conll`\n```\n\nYou also may enter the input text in pipeline:\n```\necho \"Mary is eating fish.\" |./deppattern en -a\n```\n\n## Configuration files\nEach grammar directory must contain the following files: \n\n* the grammar (the name of the file is chosen by the user)\n* tagset.conf\n* dependencies.conf\n* lexical_classes.conf\n \nFor more details, look up the  [tutorial of DepPattern](http://gramatica.usc.es/pln/tools/deppattern/html_tutorial/tutorialGrammar.html)\n\n## MetaRomance\nOne of the parsers provided by the package is MetaRomance, made of Universal Dependencies for Romance languages, and one of the systems that participated at CoNLL-2017 Shared Task on multilingual dependency parsing. If the input text is in Portuguese, the command to run MetaRomance would be the following:\n\n```\n    ./deppattern pt -m -f tests/test-pt -a\n```\nMore information in:\n\nGarcia, Marcos and Pablo Gamallo (2017) \"A rule-based system for cross-lingual parsing of Romance languages with Universal Dependencies\", ConLL-2017, Vancouver, Canada.\n\n\n## INPUT FILE\nThe input file must be in plain text format, and codified in UTF8.\n\n\n## GRAMMAR FILE\nThe file containing the grammar must be in plain text format. \nBelow, you'll find a toy example of a grammar with 4 dependency-based rules:\n\n\n###### GRAMMAR #########\n```\nAdjnR:  NOUN  ADJ\nAgr: number, genre\n%\n\nSpecL:  DT  NOUN \nAgr: number, genre\n%\n\nSubjL:  NOUN  [ADV]* VERB\nAgr: number\n%\n\nDobjR:  VERB [ADV]* NOUN\n%\n```\n\nLook up the tutorial stored in the doc directory. \n\n\n\n## OUTPUT FORMAT \n### BASIC ANALYSIS (flag -a):\nOption -a means that deppattern generates a specific output based on triples. Each analysed sentence consists of two elements:\n\n1. A line containing the POS tagged lemmas of the sentence. This line begins with the tag SENT. The set of tags used here are listed in file TagSet.txt. All lemmas are identified by means of a position number from 1 to N, where N is the size of the sentence.\n\n2. All dependency triples identified by the grammar. A triple consists of:\n\n(relation;head_lemma;dependent_lemma)\n\nFor instance, the sentence \"I am a man.\" generates the following output:\n\n```\nSENT::\u003cI_PRO_0_\u003cnumber:0|lemma:I|possessor:0|case:0|genre:0|person:0|politeness:0|type:P|token:I|\u003e am_VERB_1_\u003cnumber:0|mode:0|lemma:be|genre:0|tense:0|person:0|type:S|token:am|\u003e a_DT_2_\u003cnumber:0|lemma:a|possessor:0|genre:0|person:0|type:0|token:a|\u003e man_NOUN_3_\u003cnumber:S|lemma:man|genre:0|person:3|type:C|token:man|\u003e ._SENT\u003e\n\n(Subj;be_VERB_1;I_PN_0)\n(Spec;man_NOM_3;a_DT_2)\n(Dobj;be_VERB_1;man_NOM_3)\n```\n\nThe set of dependency relationships used by the 5 grammars can be consulted and modified in the corresponding configuration file: `grammars/grammar-devel-LING/dependencies.conf`.\n\nMorpho-syntactic information is provided by the POS tagger, also included in [Linguakit](https://github.com/citiususc/Linguakit) . \n\n### FULL ANALYSIS (flag -fa):\nOption -fa gives rise to a full represention of the output triples. Each triple is associated with two pieces of information: morpho-syntactic features of both the head and the dependent. \n\n\n### TAGGED TEXT (flag -c):\nOption -c allows us to generate a file with the same input (a tagged text) but with some corrections proposed by the grammar. This option is useful to identify and correct regular errors of PoS taggers using grammatical rules. \n\n### CONLL FORMAT (flag -conll):\nIt is also possible to get an output file with the format defined by CoNLL-X, inspired by Lin (1998). This format was adopted by the evaluation tasks defined in CoNLL.\n\n## AUTHORS\nPablo Gamallo, Isaac González, Marcos Garcia, César Piñeiro, Grupo ProLNat@GE, CiTIUS,  University of Santiago de Compostela, Galiza.\n\n## REFERENCES\n\u003eGamallo P. , González I. (2011) A Grammatical Formalism Based on Patterns of Part-of-Speech Tags , International Journal of Corpus Linguistics , 16(1), 45-71. ISNN:1384-6655 \n\n\u003eGamallo, P. 2015. Dependency Parsing with Compression Rules, The 14th International Conference on Parsing Technologies (IWPT-2015) p. 107-117, Bilbao. ISBN 978-1-941643-98-3 \n\n\u003eGamallo, P., González, I. 2012. DepPattern: A Multilingual Dependency Parser, Demo Session of the International Conference on Computational Processing of the Portuguese Language (PROPOR 2012) , April 17-20, Coimbra, Portugal. \n\n\n\n\t\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcitiususc%2Fdeppattern","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcitiususc%2Fdeppattern","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcitiususc%2Fdeppattern/lists"}