-
Notifications
You must be signed in to change notification settings - Fork 9
Operation
Sotiris edited this page Jul 10, 2019
·
2 revisions
This page illustrates a step-by-step procedure to set up this project
The procedure of installation is outlined in the Installation Page
- In order to setup the project you need to gather Government Gazette Documents from ET either by hand or using the Fetching Tool to either fetch using your own parameters or schedule the task.
- Put the data in directory. For example:
data/
|- file1.{pdf,txt}
|- file2.{pdf,txt}
...
|- filen.{pdf,txt}
- If the data is already in
.txt
format then you can head over Step 3
If the documents are in PDF format (either contain text or not) you should convert them to plain text format. For this purpose you will need to follow the steps outlined here to setup the conversion process. Then you can batch-convert the documents with one command:
python3 scripts/converter.py -input_dir ../data/1998/ -output_dir ../data/1998/ -pdf2txt pdf2txt.py
- Populate the database with detected laws
>>> from codifier import LawCodifier
>> cod = LawCodifier('../data/new')
- Get the new laws published at the GG Issues (ΦΕΚ Α')
>> cod.codify_new_laws()
- Codify the a law using the
codify_law(law)
command (under development)
>>> cod.codify_law(ν. 4448/2018')
- Get a law as a string or export it to PDF via the Texification Tool using
xelatex
# as a string
>> result = cod.get_law('ν. 4448/2018')
# or a pdf using xelatex
>> cod.texify_law('ν. 4448/2018', 'Κωδικοποιημένος_Νόμος.pdf')
- The data is organized in the MongoDB database in versions for easier lookup. The contents of each version are organized in periods.
_id: "ν. 4448/2018"
versions: Array
0: Object
articles: Object
1: Object
0: Array
0: "Τα Μέρη, στο πλαίσιο του παρόντος Μνημονίου Κατανόησης και σύμφωνα με ..."
2: Object
lemmas: Object
titles: Object
_version: 0
amendee: "ν. 4448/2018"
- For more details visit the Codifier page
- Navigate to
angularui/
- Run
npm install
to install project dependencies. - Run
ng build
to compile the project. - Run
ng serve
to serve the project. - Navigate to
localhost:4200
where the application is deployed.
Follow this guide to deploy the flask application with nginx and gunicorn.
Run gunicorn via:
gunicorn --workers NWORKERS app:app -b localhost:8000
Configuration file at /etc/nginx/conf.d/virtual.conf
server {
listen 80;
server_name 3gm.papachristoumarios.me openlaws.ellak.gr 3gm.ellak.gr;
location / {
proxy_pass http://127.0.0.1:8000;
}
}
Supervisor configuration:
[program:3gm]
directory=/var/www/gsoc2018-3gm/3gm
command=gunicorn --workers 3 app:app -b localhost:8000
autostart=true
autorestart=true
stderr_logfile=/var/log/3gm.err.log
stdout_logfile=/var/log/3gm.out.log
- Getting started
- Algorithms
- Datasets and Continuous Integration
- Documentation
- Development