Difference between revisions of "Apertium-viewer"
Line 4: | Line 4: | ||
The various stages update ''while you type'', and a change made in any one pane updates the subsequent stages. |
The various stages update ''while you type'', and a change made in any one pane updates the subsequent stages. |
||
[[Image:Screenshot-jApertiumView.png|thumb|400px|right|A screen shot. Some stages are hidden (split panes have been moved |
[[Image:Screenshot-jApertiumView.png|thumb|400px|right|A screen shot. Some stages are hidden (split panes have been moved together)]] |
||
Such a tool is invaluable when you want to work with a language pair. |
Such a tool is invaluable when you want to work with a language pair. |
||
Line 10: | Line 10: | ||
== What you need == |
== What you need == |
||
* Java |
* Java JRE 1.6 |
||
* Apertium |
|||
== Installing and running apertium-viewer == |
== Installing and running apertium-viewer == |
||
Line 17: | Line 16: | ||
You don't have to install anything (except Java and a browser)! |
You don't have to install anything (except Java and a browser)! |
||
Just point your Java-enabled browser to |
Just point your Java-enabled browser to https://apertium.svn.sourceforge.net/svnroot/apertium/builds/apertium-viewer/launch.jnlp and start working. You will need to accept to trust the application since it will access your file system (to use your local language pairs) and it can invoke external programs (if external processing is enabled or the pair has external dependencies). |
||
Accept to trust the application (it is using your local installation of Apertium). |
|||
You can also save the link, rename it and put it in your start menu |
You can also save the link, rename it and put it in your start menu (nice for off-line use). |
||
(nice for off-line use). |
|||
If this doesent work for you, try typing from the command line: |
If this doesent work for you, try typing from the command line: |
||
<pre> |
<pre> |
||
javaws |
javaws https://apertium.svn.sourceforge.net/svnroot/apertium/builds/apertium-viewer/launch.jnlp |
||
</pre> |
</pre> |
||
Line 31: | Line 28: | ||
For faster startup (or if Java webstart doesent work for you), you can download manually to your PC by |
For faster startup (or if Java webstart doesent work for you), you can download manually to your PC by |
||
wget --no-host-directories -r |
wget --no-host-directories -r https://apertium.svn.sourceforge.net/svnroot/apertium/builds/apertium-viewer/ |
||
now skip the Java webstart step by double-clicking on apertium-viewer.jar or typing |
now skip the Java webstart step by double-clicking on apertium-viewer.jar or typing |
||
Line 42: | Line 39: | ||
Many modern macs come with an old JDK 1.5. Make sure JDK 1.6 is installed and paste |
Many modern macs come with an old JDK 1.5. Make sure JDK 1.6 is installed and paste |
||
/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands/javaws |
/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands/javaws https://apertium.svn.sourceforge.net/svnroot/apertium/builds/apertium-viewer/launch.jnlp |
||
into the terminal |
into the terminal |
||
Line 71: | Line 68: | ||
java -jar apertium-viewer.jar |
java -jar apertium-viewer.jar |
||
</pre> |
</pre> |
||
from the command line. Remember to use |
from the command line. Remember to use JRE 1.6 (java -version shows the version number) |
||
(but if you really insist on going the longest possible way you can compile from command line with ant and then type <code>java -cp "lib/swing-app-framework/appframework-1.0.3.jar:lib/swing-app-framework/swing-worker-1.1.jar:dist/apertium-viewer.jar" apertiumview.ApertiumViewMain</code>) |
(but if you really insist on going the longest possible way you can compile from command line with ant and then type <code>java -cp "lib/swing-app-framework/appframework-1.0.3.jar:lib/swing-app-framework/swing-worker-1.1.jar:dist/apertium-viewer.jar" apertiumview.ApertiumViewMain</code>) |
||
Line 81: | Line 78: | ||
Just choose File | Load mode and select the mode file from the language pair. |
Just choose File | Load mode and select the mode file from the language pair. |
||
[[Image:Screenshot-jApertiumView-OpenMode.png|thumb|300px|right|Opening a mode file]] |
[[Image:Screenshot-jApertiumView-OpenMode.png|thumb|300px|right|Opening a mode file]] |
||
Since version 2.0 [[Language pair packages#List of ready-to-use packages|online language pairs]] are also supported. You can choose any of the 24 online pairs that are available and work with them as if they where installed locally, even if they aren't! |
|||
==Features== |
==Features== |
||
Line 109: | Line 108: | ||
* Run via Java WebStart, so user doesent have to install anything (apart from Java). |
* Run via Java WebStart, so user doesent have to install anything (apart from Java). |
||
=== Version 1.3 (5 December 2008) === |
=== Version 1.3 (5 December 2008) === |
||
Line 124: | Line 122: | ||
* Much improved highlighting: Different colors for ambigious and unrecognized words, and for chunks |
* Much improved highlighting: Different colors for ambigious and unrecognized words, and for chunks |
||
* A "Hide intermediate" button hides all but input and output text |
* A "Hide intermediate" button hides all but input and output text |
||
=== Version 1.5 (21 nov 2010) === |
=== Version 1.5 (21 nov 2010) === |
||
Line 130: | Line 127: | ||
* Option to ignore error messages from commands (stderr) to make it usable for Gramtrans stuff |
* Option to ignore error messages from commands (stderr) to make it usable for Gramtrans stuff |
||
=== Version 2.0 (16 aug 2012) === |
|||
* Completely based on [[lttoolbox-java]]. This removes the requirement of a local Apertium installation, and offers a much higher translation speed. External processing can still be enabled in the options. |
|||
* Support for the 24 [[Language pair packages#List of ready-to-use packages|online language pairs]]. All these pairs can be used within the application without the need of having them locally. |
|||
* Full and meaningful names for the modes (for instance, "Basque → Spanish" instead of "eu-es"). |
|||
===Feature requests/bugs=== |
===Feature requests/bugs=== |
Revision as of 16:25, 16 August 2012
Apertium-viewer is a little program which can be used to view and edit the output of the various stages of an apertium translation.
The various stages update while you type, and a change made in any one pane updates the subsequent stages.
Such a tool is invaluable when you want to work with a language pair.
What you need
- Java JRE 1.6
Installing and running apertium-viewer
You don't have to install anything (except Java and a browser)!
Just point your Java-enabled browser to https://apertium.svn.sourceforge.net/svnroot/apertium/builds/apertium-viewer/launch.jnlp and start working. You will need to accept to trust the application since it will access your file system (to use your local language pairs) and it can invoke external programs (if external processing is enabled or the pair has external dependencies).
You can also save the link, rename it and put it in your start menu (nice for off-line use).
If this doesent work for you, try typing from the command line:
javaws https://apertium.svn.sourceforge.net/svnroot/apertium/builds/apertium-viewer/launch.jnlp
Faster startup
For faster startup (or if Java webstart doesent work for you), you can download manually to your PC by
wget --no-host-directories -r https://apertium.svn.sourceforge.net/svnroot/apertium/builds/apertium-viewer/
now skip the Java webstart step by double-clicking on apertium-viewer.jar or typing
java -jar apertium-viewer/apertium-viewer.jar
this gives a loading time on 0.5 seconds (java web start takes 4 seconds) on my PC
Mac users
Many modern macs come with an old JDK 1.5. Make sure JDK 1.6 is installed and paste
/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands/javaws https://apertium.svn.sourceforge.net/svnroot/apertium/builds/apertium-viewer/launch.jnlp
into the terminal
Getting, compiling and running apertium-viewer from source
Check out the source code (Netbeans project) from the subversion repository (apertium-tools/apertium-viewer
)
svn co https://apertium.svn.sourceforge.net/svnroot/apertium/trunk/apertium-viewer cd apertium-viewer ant ant run
To run it's easiest just to type 'ant run' or use Netbeans to compile.
Running apertium-viewer
Running the binary: Just double-click on apertium-viewer.jar
If this doesn't work, type
java -jar apertium-viewer.jar
from the command line. Remember to use JRE 1.6 (java -version shows the version number)
(but if you really insist on going the longest possible way you can compile from command line with ant and then type java -cp "lib/swing-app-framework/appframework-1.0.3.jar:lib/swing-app-framework/swing-worker-1.1.jar:dist/apertium-viewer.jar" apertiumview.ApertiumViewMain
)
Testing unreleased language pairs from subversion
At startup Apertium-viewer will scan for languages installed on the system.
But you don't need to install your own language pairs anywhere to use it! All what is needed is to compile the language pair with 'make' and point to the .mode file generated. Just choose File | Load mode and select the mode file from the language pair.
Since version 2.0 online language pairs are also supported. You can choose any of the 24 online pairs that are available and work with them as if they where installed locally, even if they aren't!
Features
- Alt-U: Set/unset 'mark unknown words'
- Alt-I: Fit text: Automatically resizing panes. Stages with unchanged text are automatically collapsed.
- Alt-C: Copy All: Puts text for all stages into clipboard
- Alt-S: Hide/Show commands (for clearer view)
- Ctrl-0/Ctrl-1 brings focus to the first pane (input),
- Ctrl-2 brings focus to the to the second pane (etc).
- Ctrl-9 brings focus to the last pane (output). It autoscrolls to make the panes fully visible.
- Ctrl-Pgup, Ctrl-PgDn: Cycle throgh the text panes
- Ctrl-Z/Ctrl-Y Undo/redo on a per text-pane/stage basis
- Ctrl-T: Make test case: Text can be copied directly into a Regression testing wiki page (also using Tools | Make Test Case...).
- Ctrl-I: Import Wiki text case
- Views can be frozen/paused to not propagate changes
- Syntax highlighting
- If a surface form has an ambigious analysis its shown in red. If you click on an alternative it is selected (basically, between / /) and can be removed it pressing Delete key.
- Removing scrollbars when not wanted.
- Configuration / choosing language pair in the GUI.
- Scroll panes down when they fill with more information.
- Zoom button to get a detached window (particularly input and output windows).
- Remember settings when closed (language pair, input text, size of panes, windows size and position etc).
- It DOESENT use dbus. Rather you can just directly point to a mode file and use it. Therefore language pairs can be tested directly from the SVN source directory, without installing them.
- Run via Java WebStart, so user doesent have to install anything (apart from Java).
Version 1.3 (5 December 2008)
- Up to 10 texts can be stored for later use
- Text field with keyboard focus is highlighted
Version 1.4 (8 apr 2010)
- Much improved highlighting: Different colors for ambigious and unrecognized words, and for chunks
- A "Hide intermediate" button hides all but input and output text
Version 1.5 (21 nov 2010)
- Option to ignore error messages from commands (stderr) to make it usable for Gramtrans stuff
Version 2.0 (16 aug 2012)
- Completely based on lttoolbox-java. This removes the requirement of a local Apertium installation, and offers a much higher translation speed. External processing can still be enabled in the options.
- Support for the 24 online language pairs. All these pairs can be used within the application without the need of having them locally.
- Full and meaningful names for the modes (for instance, "Basque → Spanish" instead of "eu-es").
Feature requests/bugs
- Restoring of view sizes after restart is not perfect yet (press Fit to text to fix)
- Shrinking view sizes not perfect yet (press Fit to text a few times to fix)
- Moving chunks as units rather than text.
- foo{ bar } baz { bin } → baz{ bin } foo { bar }
- Re-use the processes instead of respawning (use null-flush)
Related software
- Apertium-view is a simpler version of the same program and coded in Python instead of Java and dequires dbus and that you install your language pairs.
- Apertium-view.sh is a short shell script that just displays output from all parts of the pipeline, no interactive features
- Apertium-tolk is similar to, but much simpler than Apertium-viewer. It only has an input window and an output window. Where Apertium-viewer is aimed at developers, Apertium-tolk is intended to be as user friendly as possible.