Difference between revisions of "Apertium-viewer"

From Apertium
Jump to navigation Jump to search
Line 66: Line 66:


==Features==
==Features==
* Allow users to set 'mark unknown words' or not (Alt-M)
* Alt-U: Set/unset 'mark unknown words'
* Automatically resizing panes (Fit text button, Alt-I). Stages with unchanged text are automatically collapsed.
* 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-0 brings focus to the first pane (input), Alt-1 to the second, etc. Alt-9 brings focus to the last (output). It autoscrolls to make the panes fully visible.
* Alt-S: Hide/Show commands (for clearer view)
* Undo on a per text-pane/stage basis (Ctrl-Z, redo is Ctrl-Y)
* Ctrl-0/Ctrl-1 brings focus to the first pane (input),
* Copy all button puts text for all stages into clipboard (Alt-C)
* Ctrl-2 brings focus to the to the second pane (etc).
* Commands can be hidden for clearer view (Alt-S)
* 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
* Views can be frozen/paused to not propagate changes
* Syntax highlighting
* Syntax highlighting
Line 85: Line 90:
[[Image:Screenshot-jApertiumView2.png‎|thumb|400px|right| When the text is the same as on the former stage it is shown with a yellow background. Commands have been hidden for a clearer view.]]
[[Image:Screenshot-jApertiumView2.png‎|thumb|400px|right| When the text is the same as on the former stage it is shown with a yellow background. Commands have been hidden for a clearer view.]]


* Text can be copied directly into a [[Regression testing]] wiki page (using Tools | Make Test Case...).
[[Image:Wiki test case paste.png|thumb|400px|right|Apertium-viewer showing a Wiki [[Regression testing]] case text ready to be pasted.]]
[[Image:Wiki test case paste.png|thumb|400px|right|Apertium-viewer showing a Wiki [[Regression testing]] case text ready to be pasted.]]


Line 91: Line 95:
* Up to 10 texts can be stored for later use --[[User:Jacob Nordfalk|Jacob Nordfalk]] 06:21, 5 December 2008 (UTC)
* Up to 10 texts can be stored for later use --[[User:Jacob Nordfalk|Jacob Nordfalk]] 06:21, 5 December 2008 (UTC)


===Version 1.1 --[[User:Jacob Nordfalk|Jacob Nordfalk]] 9 April 2009===
* Can also import Wiki text cases
[[Image:Apertium-Viewer_Wiki_test_case_import.png|thumb|400px|right|Apertium-viewer import of a Wiki [[Regression testing]] case.]]
[[Image:Apertium-Viewer_Wiki_test_case_import.png|thumb|400px|right|Apertium-viewer import of a Wiki [[Regression testing]] case.]]
* Use Ctrl-Pgup, Ctrl-PgDn to go switch to the upper/downer text panel
* Text field with keyboard focus is highlighted
* Text field with keyboard focus is highlighted



Revision as of 07:00, 30 April 2009

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.

A screen shot. Some stages are hidden (split panes have been moved togehter)

Such a tool is invaluable when you want to work with a language pair.

What you need

  • Java JDK 1.6
  • Apertium

Installing and running apertium-viewer

You don't have to install anything!

Just point your Java-enabled browser to http://javabog.dk:8080/apertium-viewer/launch.jnlp and start working. 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 (nice for off-line use).

If this doesent work for you, try typing from the command line:

javaws http://javabog.dk:8080/apertium-viewer/launch.jnlp


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

It this don't work, type

java -jar apertium-viewer.jar

from the command line. Remember to use JDK 1.6 (java -version shows the version number)

(but if you really insist on going the longes 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.

Opening a mode file

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.
A click on an ambigious analysis selects one posibility (press Del to delete it). Also the freeze button is shown.
  • 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.
When the text is the same as on the former stage it is shown with a yellow background. Commands have been hidden for a clearer view.
Apertium-viewer showing a Wiki Regression testing case text ready to be pasted.
  • Run via Java WebStart, so user doesent have to install anything (apart from Java).
  • Up to 10 texts can be stored for later use --Jacob Nordfalk 06:21, 5 December 2008 (UTC)
Apertium-viewer import of a Wiki Regression testing case.
  • Text field with keyboard focus is highlighted


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 }

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-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.