{"id":13714113,"url":"https://github.com/Attempto/APE","last_synced_at":"2025-05-07T01:32:18.796Z","repository":{"id":1892469,"uuid":"2818606","full_name":"Attempto/APE","owner":"Attempto","description":"Parser for Attempto Controlled English (ACE)","archived":false,"fork":false,"pushed_at":"2024-04-21T20:57:50.000Z","size":3827,"stargazers_count":182,"open_issues_count":16,"forks_count":28,"subscribers_count":26,"default_branch":"master","last_synced_at":"2024-05-23T04:34:27.648Z","etag":null,"topics":["ace","attempto","cnl","nlp","swi-prolog"],"latest_commit_sha":null,"homepage":"http://attempto.ifi.uzh.ch/ape/","language":"Prolog","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"DocuSignDev/node-redis-sentinel-client","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Attempto.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE.txt","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":"2011-11-21T08:55:26.000Z","updated_at":"2024-08-03T00:05:56.593Z","dependencies_parsed_at":"2024-04-13T23:27:52.108Z","dependency_job_id":"b746ae24-4728-45d2-819a-71d5ca1af1b0","html_url":"https://github.com/Attempto/APE","commit_stats":{"total_commits":118,"total_committers":9,"mean_commits":13.11111111111111,"dds":0.423728813559322,"last_synced_commit":"61c9b264ddc813eb60a0f624de5645b4d202780f"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Attempto%2FAPE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Attempto%2FAPE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Attempto%2FAPE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Attempto%2FAPE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Attempto","download_url":"https://codeload.github.com/Attempto/APE/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224551162,"owners_count":17330089,"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":["ace","attempto","cnl","nlp","swi-prolog"],"created_at":"2024-08-02T23:01:52.530Z","updated_at":"2024-11-14T01:30:39.612Z","avatar_url":"https://github.com/Attempto.png","language":"Prolog","funding_links":[],"categories":["Prolog"],"sub_categories":[],"readme":"APE - ACE Parsing Engine\n========================\n\nAuthors: Kaarel Kaljurand, Norbert E. Fuchs, Tobias Kuhn\n\n\nIntroduction\n------------\n\nThis document explains how APE (ACE Parsing Engine) is compiled and used.\n\nIn order to compile and run APE, you first need to install a recent version of SWI-Prolog.\nSWI-Prolog is free software and can be downloaded from \u003chttp://www.swi-prolog.org\u003e. Note that you\nminimally need to install the following SWI Prolog packages: `clib`, `sgml`, and `http`. To view\nthe documentation embedded in the source files you also need `pldoc`.\n\n\nCompilation\n-----------\n\nBefore you can run APE, you have to compile the APE source code. Just execute the file\n`make_exe.bat` in the case of Windows or `make install` in the case of Mac OS X, Linux, or any other\nUnix system. Both the bat-file and the Makefile are located in the root directory of the APE distribution. As a result (and\ngiven that there were no compilation errors), a new file `ape.exe` is created in the current\ndirectory.\n\n(In some unlikely cases you might have to change the size of the memory areas\nused by SWI-Prolog. This is documented at \u003chttp://www.swi-prolog.org/pldoc/man?section=memlimit\u003e.)\n\n\nExecution\n---------\n\nAPE has to be executed from the command-line. In the command-line terminal, go to the root\ndirectory of APE (where `ape.exe` is located). Then type `ape.exe` in the case of Windows or\n`./ape.exe` otherwise. As a result, you should see the following output:\n\n    Attempto Parsing Engine for ACE 6.7, version 6.7-131003\n    Copyright 2008-2013, Attempto Group, University of Zurich\n    This program comes with ABSOLUTELY NO WARRANTY.\n    This is free software, and you are welcome to redistribute it under certain conditions.\n    Please visit http://attempto.ifi.uzh.ch for details.\n    \n    Command-line arguments:\n    -text \"TEXT\"        The input ACE text. If neither -text nor -file is present then the ACE text\n                        is read from stdin.\n    -file FILENAME      The name or URL of the input file containing the ACE text.\n    -ulextext \"TEXT\"    The user lexicon (taken from a string).\n    -ulexfile FILENAME  The user lexicon (taken from a file or URL).\n    -solo OUTPUT        Output just one output component. OUTPUT has to be one of {paraphrase,\n                        paraphrase1,paraphrase2,owlfss,owlfsspp,owlrdf,owlxml,ruleml,fol,pnf,tptp,\n                        tokens,syntax,syntaxpp,syntaxd,syntaxdpp,drs,drsxml,drspp,drshtml}.\n    -cdrs               Output the DRS as a Prolog term.\n    -cdrsxml            Output the DRS in XML.\n    -cdrspp             Output the DRS in pretty-printed form in plain text.\n    -cdrshtml           Output the DRS in pretty-printed form in HTML.\n    -cparaphrase        Output a paraphrase which is a \"best-effort\" combination of paraphrase1 and\n                        paraphrase2.\n    -cparaphrase1       Output a paraphrase which uses full sentences instead of relative clauses.\n    -cparaphrase2       Output a paraphrase which uses relative clauses instead of full sentences.\n    -ctokens            Output tokens as a Prolog list of lists.\n    -csentences         Output sentences as a Prolog list.\n    -csyntax            Output simplified syntax trees as a Prolog list.\n    -csyntaxpp          Output simplified syntax trees in pretty-printed form.\n    -csyntaxd           Output plain syntax trees as a Prolog list (for debugging).\n    -csyntaxdpp         Output plain syntax trees in pretty-printed form (for debugging).\n    -cowlfss            Output OWL/SWRL in the Functional-Style Syntax representation (as Prolog\n                        term).\n    -cowlfsspp          Output OWL/SWRL in the Functional-Style Syntax representation (pretty-\n                        printed).\n    -cowlxml            Output OWL/SWRL in the XML representation.\n    -cowlrdf            Output OWL/SWRL in the RDF/XML representation. DEPRECATED\n    -cruleml            Output RuleML representation of the DRS.\n    -cfol               Output standard first-order logic representations (default form) of the DRS\n                        as a Prolog term.\n    -cpnf               Output standard first-order logic representations (prenex normal form) of\n                        the DRS as a Prolog term.\n    -ctptp              Output TPTP representation of the DRS.\n    -uri URI            URI for the OWL outputs.\n    -noclex             Ignore the lexicon entries that are compiled into the executable.\n    -guess              Guess the word-class of unknown words.\n    -server             Launch a socket interface to APE at port 2766 (0xACE).\n    -httpserver         Launch an HTTP interface to APE at port 8000.\n    -port NUMBER        Override the default port of either the socket or the HTTP interface.\n    -version            Shows version information.\n    -help               Shows this help page.\n\nAPE can be used via four different interfaces:\n\n- command-line interface\n- socket interface\n- HTTP interface (webservice)\n- directly from Prolog or Java\n\nAll these possibilities are described in the following sections.\n\n\n### Command-line interface to APE\n\nThe following command parses the text \"John waits.\" and outputs the DRS in XML representation and\nthe syntax tree:\n\n    ./ape.exe -text \"John waits.\" -cdrsxml -csyntax\n\nIn the case of Windows, you have to omit the first two characters `./`. The next example parses the\ntext that is inside of the file `ace.txt` and outputs the OWL FSS representation:\n\n    ./ape.exe -file ace.txt -solo owlfss\n\nIf you omit both arguments, `text` and `file`, the ACE text is read from the standard input:\n\n    echo \"Every mammal is an animal.\" | ./ape.exe -solo drspp\n\nNote that this does not work under Windows.\n\nIf you just execute the line\n\n    ./ape.exe -solo drspp\n\nthen the terminal waits for an input. In this case, you can type your ACE text into the terminal\nwindow. Once you have done so, press `Enter` and `Ctrl-D` to tell the terminal that you are\nfinished. The output (the pretty printed DRS in our case) is then shown below the ACE text you just\nentered. Again, this does not work under Windows.\n\n\n### Socket interface to APE\n\nA socket interface to APE is started by giving the argument `-server` to APE. The default port,\n2766 (0xACE), can be overridden by specifying a different port number as a value to the argument\n`-port`.\n\nA good way to start the server on a Unix command-line (e.g. _bash_) is:\n\n    nohup swipl -x ape.exe -- -server -port 3453 \u003e stdout.txt 2\u003e stderr.txt \u0026\n\nOn Mac OS X, one could use _launchctl_ instead.\n\nThe socket interface knows only one command:\n\n    get(Parameters).\n\nwhere `Parameters` is a list of parameters accepted by `get_ape_results/2`. Note the dot at the end\nof the command! (There should also be a newline after the dot.) Given the input, the server runs\n`get_ape_results/2` on it and sends back the results, followed by\n`APESERVERSTREAMEND` on a separate line. If the input command is syntactically incorrect then an\nerror message is logged into STDERR. In any case, the connection to the client is closed.\n\nExamples of input commands:\n\n    get([text='Every man is a human.', cparaphrase1=on]).\n    get([text='Every man is a human.', solo=paraphrase1]).\n    get([text='Every man is a a human.', cparaphrase1=on]).\n    get([text='Every man is a human.', cinput=on, cdrs=on, cparaphrase=on, ctokens=on, csyntax=on]).\n\nSession example, assuming that the APE socket server listens at port 3453:\n\n    $ telnet 127.0.0.1 3453\n    Trying 127.0.0.1...\n    Connected to localhost.\n    Escape character is '^]'.\n    get([text='Every man is a human.', solo=paraphrase1]).\n    If there is a man X1 then the man X1 is a human.\n    APESERVERSTREAMEND\n    Connection closed by foreign host.\n\n\n### HTTP interface to APE\n\nAn HTTP interface to APE is started by giving the argument `-httpserver` to APE. The default port,\n8000, can be overridden by specifying a different port number as a value to the argument `-port`.\n\nA good way to start the server on a Unix command-line (e.g. _bash_) is:\n\n    nohup swipl -x ape.exe -- -httpserver -port 8001 \u003e stdout.txt 2\u003e stderr.txt \u0026\n\nOn Mac OS X, one could use _launchctl_ instead.\n\nIn case there is an error message in the error output, saying that\n\n    ERROR: socket_error(Address already in use)\n\nthen try another port number. For example, one would get this error when running the above command\ntwice: during the first time a server is started which starts to listen requests at port 8001,\nduring the second time a second server is started but since the port is already being used by the\nfirst server, there is a conflict and the second server crashes.\n\nYou can test the server by loading the following URL in your browser.\n\n    http://localhost:8001/?text=Every+man+is+a+human.\u0026solo=drshtml\n\nThe result should be an HTML-rendering of the DRS of the sentence \"Every man is a human.\".\n\nThe complete description of this webservice interface as well as some example clients are available\nat http://attempto.ifi.uzh.ch/site/docs/ape_webservice.html. (Note though that the parameter\n`ulexreload` is not supported by this HTTP interface.)\n\nNote that the parameter names and values, and their meaning is the same as for the command-line\nclient. Also the results' format is the same. The only difference is that for security reasons the\nwebservice cannot access local files, i.e. the input ACE text can be passed as a string or via a\npointer an HTTP resource (i.e. URL) but not via pointing to a local file (such as\n`/var/acetexts/sometext.ace.txt`).\n\n\n### Using APE from Java programs\n\nSee the documentation in [java/](java/).\n\n\n### Some examples\n\nACE text from URL\n\n    ./ape.exe -file http://attempto.ifi.uzh.ch/site/acetexts/example1.ace.txt -solo owlxml\n\nLexicon from string\n\n    ./ape.exe -text \"Every mman is a hhuman.\" -ulextext \"noun_sg(mman, mman, masc). noun_sg(hhuman, hhuman, neutr).\" -cparaphrase1\n\nLexicon from a file\n\n    echo \"noun_sg(mman, mman, masc). noun_sg(hhuman, hhuman, neutr).\" \u003e ulex.pl\n    ./ape.exe -text \"Every mman is a hhuman.\" -ulexfile ulex.pl -cparaphrase1\n\nReading from STDIN and writing to STDOUT can be used in order to chain several executions of APE\ntogether. The following example paraphrases the paraphrase of \"Every man is a human.\".\n\n    ./ape.exe -text \"Every man is a human.\" -solo paraphrase1 | ./ape.exe -solo paraphrase2\n\nThe following commands have the same meaning.\n\n    ./ape.exe -httpserver\n    swipl -x ape.exe -- -httpserver\n    swipl -x ape.exe -g http_server\n\nThe only difference is in the the way SWI Prolog is called, either via the full path name embedded\nin `ape.exe` or via the name `swipl` which the command-line environment must resolve to the full\npath name.\n\nBy overriding the goal (with `-g`), it is also possible to execute SWI-Prolog commands in the\ncontext of `ape.exe`. For example, the following command displays the source code of `ape.exe`.\n\n    swipl -x ./ape.exe -g listing\n\n\nCode\n----\n\nThe distribution includes the following packages containing the main code in Prolog\n(in the prolog-directory):\n\n- `logger/`  contains the error logger module\n- `lexicon/` contains various lexicon files, notably a content words lexicon with ~2,000 entries\n- `utils/`   contains various modules, mostly for translating the Discourse Representation\n             Structure (DRS) generated by APE into other logical forms\n- `parser/`  contains the Attempto Parsing Engine (APE) (tokenizer, grammar files, anaphoric\n             reference resolver)\n\nThis listing reflects the dependencies: `logger` depends on no other package. `lexicon` only\ndepends on `logger`. The package `utils` only depends on `logger` and `lexicon`. The package\n`parser`, finally, depends on all three other packages. The files in the root directory depend on\nthose packages, but not vice versa.\n\nProvided that you have PlDoc installed (SWI-Prolog package `pldoc`), you can view the documentation\nby:\n\n    ?- doc_server(1234), [get_ape_results], doc_browser.\n\nApart from these main packages, there are some additional folders:\n\n- `examples/` contains some Prolog examples of how to programmatically access APE\n- `java/`     contains the code of the Java binding for APE\n- `tests/`    contains various tests\n- `tools/`    contains some auxiliary scripts\n\nFor more information consult the commented source files.\n\n\nMailing List\n------------\n\nIf you encounter problems, you can get help from the Attempto community. Visit the Attempto Mailing\nList site:\n\n  http://attempto.ifi.uzh.ch/site/mailinglist/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAttempto%2FAPE","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAttempto%2FAPE","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAttempto%2FAPE/lists"}