Attempto / APE

Parser for Attempto Controlled English (ACE)
http://attempto.ifi.uzh.ch/ape/
Other
188 stars 28 forks source link

Package the APE modules as a SWI-Prolog extension package #4

Open Kaljurand opened 12 years ago

Kaljurand commented 12 years ago

See more: http://www.swi-prolog.org/howto/Pack.html

whitten commented 8 years ago

What happened with this? Did the APE modules get packaged as SWI-Prolog extensions 4 years ago?

tkuhn commented 8 years ago

I don't think this has ever happened, which is also why this issue is still open...

Kaljurand commented 8 years ago

To my knowledge nobody has worked on this issue.

Kaljurand commented 6 years ago

APE can now be installed via SWI-Prolog's package manager, but some improvements would be needed:

Keeping this issue open until these things are resolved. Also, the README should still be updated to document the new way of installation.

@tkuhn and @fnogatz, any ideas?

$ swipl
Welcome to SWI-Prolog (threaded, 64 bits, version 7.6.4)
...

?- pack_list_installed.
% There are no extra packages installed.
% Please visit http://www.swi-prolog.org/pack/list.
true.

?- pack_install('APE').
% Contacting server at http://www.swi-prolog.org/pack/query ... done
Warning: No registered pack matches "APE"
false.

?- pack_install('https://github.com/Attempto/APE.git').

Create directory for packages
   (1) * /home/kaarel/lib/swipl/pack
   (2)   Cancel

Your choice? 
% Cloning into '/home/kaarel/lib/swipl/pack/APE'...
Verify package status (anonymously)
    at "http://www.swi-prolog.org/pack/query" Y/n? 
% Contacting server at http://www.swi-prolog.org/pack/query ... ok
% "APE.git" was downloaded 1 times
Package:                APE
Title:                  Parser for Attempto Controlled English (ACE)
Installed version:      6.7.180715
Author:                 Kaarel Kaljurand <kaljurand@gmail.com>, Norbert E. Fuchs <fuchs@ifi.uzh.ch>, Tobias Kuhn <kuhntobias@gmail.com>
Home page:              https://github.com/Attempto/APE
Download URL:           https://github.com/Attempto/APE/releases/*.zip
Run post installation scripts for pack "APE" Y/n? 
% Targets:
% 
%   build: builds ape.exe
%     doc: generates documentation
%   clean: deletes automatically generatable files
%    test: runs some tests
% 
% make: Nothing to be done for 'check'.
% swipl -O -F none -g "working_directory(_, 'prolog/parser'), [fit_to_plp], halt." -t halt ; swipl -O -f ape.pl -g "qsave_program('ape.exe', [goal(ape), toplevel(halt)])." -t halt
% Reading "sorts.fit"
% Reading "grammar.fit"
% [...]
% % Autoloader: iteration 1 resolved 14 predicates and loaded 114 files in 0.449 seconds.  Restarting ...
% % Autoloader: loaded 14 files in 2 iterations in 0.571 seconds
true.

?- pack_list_installed.
Installed packages (1):

i APE@6.7.180715            - Parser for Attempto Controlled English (ACE)
true.

?- assert(user:file_search_path(pack, '/home/kaarel/lib/swipl/pack/APE/prolog/')).
true.

?- use_module(pack(ape)).
Warning: /home/kaarel/lib/swipl/pack/APE/prolog/utils/drs_to_html.pl:38:
    Deprecated declaration has no effect: style_check(atom)
true.

?- get_ape_results([text='John waits.', solo=drs], ContentType, Content).
ContentType = 'text/plain',
Content = 'drs([A],[predicate(A,wait,named(\'John\'))-1/2])'.

?- halt.

$ $HOME/lib/swipl/pack/APE/ape.exe -text 'John waits.' -solo drs
drs([A],[predicate(A,wait,named('John'))-1/2])
fnogatz commented 6 years ago

Answering the questions by @Kaljurand in https://github.com/Attempto/APE/issues/4#issuecomment-405074820:

the official package list (http://www.swi-prolog.org/pack/list) does not contain an entry for "APE".

According to SWI-Prolog's documentation package names should be all lowercase letters:

name(Pack) Name of the pack. This must be provided. Must consists of ASCII characters that can always appear in filenames. Due to case (in) sensitivity characters, use lowercase letters. Use _ as word separator.

Even if it might be possible, I would not recommend using uppercase letters. There is currently not a single package name that has an uppercase letter, and calls like use_module(library('APE')) are simply not usual in SWI.

The entry for "ape" represents an older experimental package from https://github.com/fnogatz/APE

SWI-Prolog does not check the package's owner. So it might be possible to easily reclaim the ape name by just installing from this repository.

not sure how to use the installed pack as a module

After a successful installation this should simply work by calling use_module(library(ape)). In library(race) I just loaded the module and made us of your tokenizer module.

JohnAZoidberg commented 5 years ago

It would be cool to have a new version released. On GitHub and on SWI.

Many changes have been made since 2013.