Difference between revisions of "Apertium VirtualBox"

From Apertium
Jump to navigation Jump to search
(Lubuntu 18.04)
(Debian Sid)
Line 3: Line 3:
 
Since so many have problems getting Apertium to run on Windows or OS X, or are limited in bandwidth, [[User:Tino_Didriksen|Tino Didriksen]] has put together a ready-to-use VirtualBox VDI:
 
Since so many have problems getting Apertium to run on Windows or OS X, or are limited in bandwidth, [[User:Tino_Didriksen|Tino Didriksen]] has put together a ready-to-use VirtualBox VDI:
   
* https://tinodidriksen.com/uploads/Apertium-VirtualBox-20191129.7z
+
* https://tinodidriksen.com/uploads/Apertium-VirtualBox-20191205.7z
* 881190318 bytes (841 MB)
+
* 520655120 bytes (496 MB)
  +
* SHA-1: 15f31b43186b85848dbd71a90b0acf234339a29e
* SHA-1: c52bf5cbe9a07b4472e3fce19822d5c5244ca3ef
 
   
 
...or if you prefer a ZIP file:
 
...or if you prefer a ZIP file:
* https://tinodidriksen.com/uploads/Apertium-VirtualBox-20191129.zip
+
* https://tinodidriksen.com/uploads/Apertium-VirtualBox-20191205.zip
* 1346057485 bytes (1283 MB)
+
* 817773930 bytes (779 MB)
  +
* SHA-1: eb4f6f29de488a2ba398de1c9947d67ef1e93854
* SHA-1: 8bcfd0940a5429bda9d17e7b5660e82ebea1f5ee
 
   
The archive decompresses to a 4.25 GB vdi file.
+
The archive decompresses to a 2.96 GB vdi file.
   
 
<span style="color: #f00;">'''Important:''' If you just want to translate, you do not need the VirtualBox image. You can instead use the much smaller [[Apertium Simpleton UI]].</span>
 
<span style="color: #f00;">'''Important:''' If you just want to translate, you do not need the VirtualBox image. You can instead use the much smaller [[Apertium Simpleton UI]].</span>
Line 18: Line 18:
 
==Contents==
 
==Contents==
   
* Lubuntu 18.04, trimmed of all non-essential packages
+
* Debian Sid, trimmed of all non-essential packages
 
* VirtualBox Guest Additions
 
* VirtualBox Guest Additions
 
* XChat, set to automatically connect to Freenode #apertium as nick ap-vbox (appending -2 or -3 on conflict), preconfigured in UTF-8 mode
 
* XChat, set to automatically connect to Freenode #apertium as nick ap-vbox (appending -2 or -3 on conflict), preconfigured in UTF-8 mode
Line 26: Line 26:
 
* HFST
 
* HFST
 
* CG-3
 
* CG-3
  +
* CG-3 IDE
 
* Apertium
 
* Apertium
 
* lttoolbox
 
* lttoolbox
Line 33: Line 34:
 
* apertium-anaphora
 
* apertium-anaphora
   
It automatically logs in to a 1024x768 desktop. All passwords set to 'apertium' for when root is needed. Keyboard and timezone are set to Danish, but you can change the keyboard layout from the top right widget.
+
It automatically logs in to a 1024x768 desktop. All passwords set to 'apertium' for when root is needed. Keyboard and timezone are set to US English, but you can change the keyboard layout from the desktop shortcut.
   
 
On first boot, it looks something like:
 
On first boot, it looks something like:
Line 39: Line 40:
 
https://tinodidriksen.com/uploads/Apertium-VirtualBox-20140418.png
 
https://tinodidriksen.com/uploads/Apertium-VirtualBox-20140418.png
   
  +
Functionality was verified by compiling and testing apertium-kaz-tat, and the result was purged to save space.
On the desktop is apertium-kaz-tat which works - compiling and testing that language pair should pretty much guarantee all required tools are installed and functional.
 
 
Nothing else from git is left checked out - all was wiped after installing in order to save space.
 
   
 
The image is set up as a dynamically expanding hdd with max size 64 GB, where 8 GB is allocated to swap space.
 
The image is set up as a dynamically expanding hdd with max size 64 GB, where 8 GB is allocated to swap space.
Line 56: Line 55:
 
==Step-by-Step Installation Instructions==
 
==Step-by-Step Installation Instructions==
   
1. Download the file (https://tinodidriksen.com/uploads/Apertium-VirtualBox-20191129.7z).
+
1. Download the file (https://tinodidriksen.com/uploads/Apertium-VirtualBox-20191205.7z).
   
2. Use 7-Zip or a similar program to unzip the file. There should be exactly one thing in the unzipped folder - the Virtual Disk Image (VDI) entitled Apertium (Lubuntu 18.04).
+
2. Use 7-Zip or a similar program to unzip the file. There should be exactly one thing in the unzipped folder - the Virtual Disk Image (VDI) entitled Apertium (Debian Sid).
   
 
3. Start VirtualBox and click "New" to create a new virtual machine.
 
3. Start VirtualBox and click "New" to create a new virtual machine.
Line 64: Line 63:
 
4. For the OS Type, select Linux, Ubuntu (32 bit).
 
4. For the OS Type, select Linux, Ubuntu (32 bit).
   
5. For Memory, give it at least 1024 MB RAM - it might run with less, but the more the better.
+
5. For Memory, give it at least 1024 MB RAM - it might run with less, but the more the better. In System, enable VT-x from the Acceleration submenu.
   
6. For Hard Disk, select the "Use an existing virtual hard drive file" radio button. Pick Apertium (Lubuntu 18.04).vdi from the drop-down menu, or if it isn't there, click the folder icon with the green arrow to the right and navigate to wherever you unzipped the file to. Finish the process by clicking "Create".
+
6. For Hard Disk, select the "Use an existing virtual hard drive file" radio button. Pick Apertium (Debian Sid).vdi from the drop-down menu, or if it isn't there, click the folder icon with the green arrow to the right and navigate to wherever you unzipped the file to. Finish the process by clicking "Create".
   
 
7. You can now run the new virtual box. On first boot it should look like this: https://tinodidriksen.com/uploads/Apertium-VirtualBox-20140418.png
 
7. You can now run the new virtual box. On first boot it should look like this: https://tinodidriksen.com/uploads/Apertium-VirtualBox-20140418.png

Revision as of 22:29, 5 December 2019

Apertium-VirtualBox.png

Since so many have problems getting Apertium to run on Windows or OS X, or are limited in bandwidth, Tino Didriksen has put together a ready-to-use VirtualBox VDI:

...or if you prefer a ZIP file:

The archive decompresses to a 2.96 GB vdi file.

Important: If you just want to translate, you do not need the VirtualBox image. You can instead use the much smaller Apertium Simpleton UI.

Contents

  • Debian Sid, trimmed of all non-essential packages
  • VirtualBox Guest Additions
  • XChat, set to automatically connect to Freenode #apertium as nick ap-vbox (appending -2 or -3 on conflict), preconfigured in UTF-8 mode
  • Firefox, homepage set to Apertium Wiki

Core tools installed via apt-get from repository https://apertium.projectjj.com/apt/ :

  • HFST
  • CG-3
  • CG-3 IDE
  • Apertium
  • lttoolbox
  • apertium-lex-tools
  • apertium-separable
  • apertium-recursive
  • apertium-anaphora

It automatically logs in to a 1024x768 desktop. All passwords set to 'apertium' for when root is needed. Keyboard and timezone are set to US English, but you can change the keyboard layout from the desktop shortcut.

On first boot, it looks something like:

https://tinodidriksen.com/uploads/Apertium-VirtualBox-20140418.png

Functionality was verified by compiling and testing apertium-kaz-tat, and the result was purged to save space.

The image is set up as a dynamically expanding hdd with max size 64 GB, where 8 GB is allocated to swap space.

Prerequisites

Step-by-Step Installation Instructions

1. Download the file (https://tinodidriksen.com/uploads/Apertium-VirtualBox-20191205.7z).

2. Use 7-Zip or a similar program to unzip the file. There should be exactly one thing in the unzipped folder - the Virtual Disk Image (VDI) entitled Apertium (Debian Sid).

3. Start VirtualBox and click "New" to create a new virtual machine.

4. For the OS Type, select Linux, Ubuntu (32 bit).

5. For Memory, give it at least 1024 MB RAM - it might run with less, but the more the better. In System, enable VT-x from the Acceleration submenu.

6. For Hard Disk, select the "Use an existing virtual hard drive file" radio button. Pick Apertium (Debian Sid).vdi from the drop-down menu, or if it isn't there, click the folder icon with the green arrow to the right and navigate to wherever you unzipped the file to. Finish the process by clicking "Create".

7. You can now run the new virtual box. On first boot it should look like this: https://tinodidriksen.com/uploads/Apertium-VirtualBox-20140418.png


Now you should have a system with all the prerequisites installed, and you should be able to follow How to bootstrap a new pair to install a language pair (and possibly any required language modules).

Clipboard

To get the clipboard working between the virtualbox and Windows/OS X, go into Options of that VBox -> General -> Advanced tab -> Clipboard -> Bidirectional.

Copying files between Windows and the Virtualbox

You can have Virtualbox mount the Windows drive through VBox's shared folder feature:

  • Click "Devices" → "Shared Folders" and find a windows folder you want to share, giving it a name like Shared. Tick "Make Permanent".
  • Create a directory in the virtualbox to share it to: sudo mkdir /media/windows-shared
  • Mount it like this: sudo mount -t vboxsf Shared /media/windows-shared
  • To mount it on each reboot, do sudo gedit /etc/rc.local and write sudo mount -t vboxsf Shared /media/windows-shared before the "exit" line.

Use

It's easy to install a new language pair on Apertium VirtualBox. The instructions differ for released apertium pairs and unreleased pairs. To get a list of released apertium pairs, run the following in a terminal:

 $ apt-cache search apertium- | grep trans

Installing a released pair

To install a released apertium language pair in Apertium VirtualBox, just run the following, substituting "nno-nob" (Nynorsk-Bokmål) with the language pair of your choice.

 $ sudo apt-get install apertium-nno-nob

Installing an unreleased pair

Using a language pair

There are several ways you can use a language pair.

1. You can pipe text through it, e.g.

 $ echo "this is random text" | apertium nno-nob

2. You can use it in interactive mode, by running it and typing text, e.g.

 $ apertium nno-nob
 this is random text

3. You can use it to translate a file; if you add a second filename, it'll output to that file, e.g.

 $ apertium nno-nob infile.txt outfile.txt

4. You can also run a file through it by piping the file's contents through it, e.g.

 $ cat file.txt | apertium nno-nob

You can then use the