Difference between revisions of "Pairviewer"
Firespeaker (talk | contribs) |
(move content from Pair viewer (with space)) |
||
Line 1: | Line 1: | ||
[[File:pairviewer.png|right|thumb|350px|The Pairviewer in action.]] |
|||
'''Pairviewer''' is an html/javascript/jquery/d3 application developed originally during GCI 2012 that displays available language pairs in apertium as a graph. |
|||
The Apertium '''Pairviewer''' is a HTML5/[https://d3js.org/ D3.js] tool that depicts all Apertium [[list of language pairs|language pairs]] in an interactive graph initially developed sometime before the [[GCI|Google Code-In]] 2013. Its source code can be [https://github.com/apertium/pairviewer found on GitHub] and an online demonstration is available [http://ilazki.thinkgeek.co.uk/~firespeaker/pairviewer/apertium.html here]. |
|||
== Setting up Pairviewer locally == |
|||
== Location == |
|||
===Clone the git repository=== |
|||
The code lives in svn at [https://svn.code.sf.net/p/apertium/svn/trunk/apertium-tools/pairviewer https://svn.code.sf.net/p/apertium/svn/trunk/apertium-tools/pairviewer]. |
|||
Enter into the folder you want it to be in and download [https://github.com/apertium/pairviewer the whole program] by running <pre>git clone https://github.com/apertium/pairviewer.git</pre> |
|||
===Set up a localhost with Python=== |
|||
A test installation is available at [http://apertium.vm.bytemark.co.uk/~firespeaker/apertium-tools/pairviewer/apertium.html http://apertium.vm.bytemark.co.uk/~firespeaker/apertium-tools/pairviewer/apertium.html]. |
|||
You need to set up a [https://en.wikipedia.org/wiki/Localhost localhost] server before you can locally run Pairviewer. |
|||
''First'', check whether you have Python installed on your system and if so, what version(s) it is. Install preferably the latest one (Python 3) if it had not been done already. |
|||
== Workings == |
|||
<pre>python -v</pre> |
|||
Pairview loads a pairs.json.txt file from the same dir. This file is generated by the pairsOut.py script (and supporting get_all_language_pairs.py script) in apertium-tools. |
|||
Then make sure to enter the folder of the git repository you have cloned. |
|||
⚫ | |||
If you have is Python 3, run: |
|||
<pre>python3 -m http.server</pre> |
|||
Otherwise, if you do have Python 2, run: |
|||
<pre>python -m SimpleHTTPServer</pre> |
|||
You should see something like this on your terminal window. |
|||
<pre>Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) <---- copy-paste this URL!</pre> |
|||
===Open on browser=== |
|||
Paste in your localhost address (e.g. <nowiki>http://0.0.0.0:80000/</nowiki>) into a browser and run. You should see a directory listing. Click the link with the label '''apertium.html'''. |
|||
This should successfully launch the Pairviewer. This step requires downloading some [https://d3js.org/ D3.js] resources, so if your internet connection is slow, this might take a while. |
|||
== Using Pairviewer == |
|||
== How Pairviewer works == |
|||
== Known bugs == |
|||
There are a few apparent bugs that should be fixed before the pair viewer goes public. |
|||
* in initial view (sometimes?), quz has no line connecting it to spa |
|||
* sometimes two- and three-letter codes don't seem to merge |
|||
** when just trunk and staging are selected, tur/tr and nob/nb are each separate from one another |
|||
** when trunk, staging, and nursery are selected, nob/nb are merged, but tur/tr are separate |
|||
* when all possible pairs are viewed (including ones with missing stems, etc.), pa doesn't have a line connecting it to ur |
|||
⚫ | |||
[[Category:Documentation in English]] |
Revision as of 05:20, 8 December 2018
The Apertium Pairviewer is a HTML5/D3.js tool that depicts all Apertium language pairs in an interactive graph initially developed sometime before the Google Code-In 2013. Its source code can be found on GitHub and an online demonstration is available here.
Contents
Setting up Pairviewer locally
Clone the git repository
Enter into the folder you want it to be in and download the whole program by running
git clone https://github.com/apertium/pairviewer.git
Set up a localhost with Python
You need to set up a localhost server before you can locally run Pairviewer.
First, check whether you have Python installed on your system and if so, what version(s) it is. Install preferably the latest one (Python 3) if it had not been done already.
python -v
Then make sure to enter the folder of the git repository you have cloned.
If you have is Python 3, run:
python3 -m http.server
Otherwise, if you do have Python 2, run:
python -m SimpleHTTPServer
You should see something like this on your terminal window.
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) <---- copy-paste this URL!
Open on browser
Paste in your localhost address (e.g. http://0.0.0.0:80000/) into a browser and run. You should see a directory listing. Click the link with the label apertium.html.
This should successfully launch the Pairviewer. This step requires downloading some D3.js resources, so if your internet connection is slow, this might take a while.
Using Pairviewer
How Pairviewer works
Known bugs
There are a few apparent bugs that should be fixed before the pair viewer goes public.
- in initial view (sometimes?), quz has no line connecting it to spa
- sometimes two- and three-letter codes don't seem to merge
- when just trunk and staging are selected, tur/tr and nob/nb are each separate from one another
- when trunk, staging, and nursery are selected, nob/nb are merged, but tur/tr are separate
- when all possible pairs are viewed (including ones with missing stems, etc.), pa doesn't have a line connecting it to ur