2014. január 26.

OCR Hungarian

After six long years I gathered my courage to face the task of OCR-ing texts again.

Goals:

1.) searchable PDF and/or DJVU from image PDF or DJVU.
one guide for PDFs uses cuneiform to ocr, and hocr2pdf to emberd text in pdf.
another option is pdfsandwich

2.) formatted text file preferably HTML from image.


Utilities:

Tesseract:
homepage: http://code.google.com/p/tesseract-ocr/
wikipedia: http://en.wikipedia.org/wiki/Tesseract_(software)
Hungarian training data: http://code.google.com/p/tesseract-ocr/downloads/detail?name=tesseract-ocr-3.02.hun.tar.gz&can=2&q=hun (which I lacked six years ago)
Other projects using Tesseract engine: http://code.google.com/p/tesseract-ocr/wiki/3rdParty

Cuneiform:
homepage: http://cognitiveforms.ru/products/cuneiform/
wikipedia: http://en.wikipedia.org/wiki/CuneiForm_(software)

hOcr2Pdf:
homepage: http://hocrtopdf.codeplex.com/

2014. január 15.

Burning DVDs and failing.

With my Samsung SE-208DB/TSBS Black.
It is connected to 2 USB slots, 1 directly and 1 with extension. 


GnomeBaker 
DVD+R, Speed: 8X, Mode: auto. 
1. Time: 71 min.
Output:

Writing an image:
I: -input-charset not specified, using utf-8 (detected in locale settings)
Using 321030_2052795755951_117000.JPG;1 for  Photos_2012_2/jul/321030_2052795755951_1177642115_n.jpg (321030_2052795755951_1177642115_n (1).jpg)
Total translation table size: 0
Total rockridge attributes bytes: 121887
Total directory bytes: 243712
Path table size(bytes): 1104
Max brk space used 108000
2174849 extents written (4247 MB)
Executing 'builtin_dd if=/home/user/Data25.iso of=/dev/sr0 obs=32k seek=0'
/dev/sr0: "Current Write Speed" is 6.1x1352KBps.
:-( unable to WRITE@LBA=16f290h: Input/output error
:-( write failed: Input/output error
/dev/sr0: flushing cache
:-( unable to FLUSH CACHE: Input/output error
:-( unable to SYNCHRONOUS FLUSH CACHE: Input/output error
Also failed.
this is simple non-sense. I have a brand new DVDRW, burned sucsessfully 3 DVD so far, and now it fails. This is unbelievable.




2. Time: 79 min.

Executing 'genisoimage -gui -V DiscLabel -A GnomeBaker -p à -iso-level 3 -l -r -hide-rr-moved -J -joliet-long -graft-points --path-list /tmp/GnomeBaker/gnomebaker-C0YY9W | builtin_dd of=/dev/sr0 obs=32k seek=0'
I: -input-charset not specified, using utf-8 (detected in locale settings)
/dev/sr0: "Current Write Speed" is 6.1x1352KBps.
Total translation table size: 0
Total rockridge attributes bytes: 224932
Total directory bytes: 428032
Path table size(bytes): 1850
Max brk space used 1e6000
2000215 extents written (3906 MB)
/dev/sr0: flushing cache
/dev/sr0: updating RMA

/dev/sr0: closing session





Here's a failure for 2 times:
Executing 'genisoimage -gui -V DataAngel_25 -A GnomeBaker -p A -iso-level 3 -l -r -hide-rr-moved -J -joliet-long -graft-points --path-list /tmp/GnomeBaker/gnomebaker-CC7X9W | builtin_dd of=/dev/sr0 obs=32k seek=0'
I: -input-charset not specified, using utf-8 (detected in locale settings)
Using 321030_2052795755951_117000.JPG;1 for  Photos_2012_2/képek facebookról Julinak/321030_2052795755951_1177642115_n.jpg (321030_2052795755951_1177642115_n (1).jpg)
/dev/sr0: "Current Write Speed" is 6.1x1352KBps.
:-( unable to WRITE@LBA=7c9d0h: Input/output error
:-( write failed: Input/output error
/dev/sr0: flushing cache
:-( unable to FLUSH CACHE: Input/output error
:-( unable to SYNCHRONOUS FLUSH CACHE: Input/output error

2014. január 5.

MobiPocket Creator usage

Download Mobipocket Creator

Follow these instructions to install Publisher Version through WINE

To create e-books:
Follow instructions

Follow User Manual

Be prepared for continuously ignoring software errors while creating e-books.

What Works?

This simple process works okay, e-book is built:
  • Create new publication
  • Add Content:
    • Insert HTML file
    • Insert Image file(s)
  • Add Cover Image
  • Add Metadata
  • (Save publication)
  • Build e-book
 What does not work?
Build fails with "error(htmlparser) no BODY tag found in content file"


KindleGen Usage

Download Kindlegen for Linux
Read publishing guidelines

Extract package anywhere

docs/english/Readme.txt content (relevant):

Creating Kindle ebooks - Advanced users:
-------------------------------------------
Advanced users can use the command line tool to convert EPUB/HTML to Kindle ebooks. This interface is available in Windows, Mac and Linux platform. This tool can be used for automated bulk conversions.

KindleGen for Linux 2.6 i386 :
1. Download the KindleGen tar.gz from www.amazon.com/kindleformat/kindlegen to a folder such as Kindlegen in home directory (~/KindleGen).
2. Extract the contents of the file to '~/KindleGen'. Open the terminal, move to folder containing the downloaded file using command "cd ~/KindleGen" and then use command "tar xvfz kindlegen_linux_2.6_i386_v2.tar.gz" to extract the contents.
3. Open the Terminal application and type ~/KindleGen/kindlegen. Instructions on how to run KindleGen are displayed.
4. Conversion Example: To convert a file called book.html, go to the directory where the book is located, such as cd desktop, and type ~/KindleGen/kindlegen book.html. If the conversion was successful, a new file called book.mobi displays on the desktop.
5. Please note: It is recommended to follow these steps to run KindleGen. Double-clicking the KindleGen icon does not launch this program. Run the above commands without quotes

Instructions on how to run KindleGen:
Navigate in terminal to folder
type ./kindlegen for usage information:
*************************************************************
 Amazon kindlegen(Linux) V2.9 build 0730-890adc2
 A command line e-book compiler
 Copyright Amazon.com and its Affiliates 2013
*************************************************************
Usage : kindlegen [filename.opf/.htm/.html/.epub/.zip or directory] [-c0 or -c1 or c2] [-verbose] [-western] [-o ]
Note:
   zip formats are supported for XMDF and FB2 sources
   directory formats are supported for XMDF sources
Options:
   -c0: no compression
   -c1: standard DOC compression
   -c2: Kindle huffdic compression
   -o : Specifies the output file name. Output file will be created in the same directory as that of input file. should not contain directory path.
   -verbose: provides more information during ebook conversion
   -western: force build of Windows-1252 book
   -releasenotes: display release notes
   -gif: images are converted to GIF format (no JPEG in the book)
   -locale : To display messages in selected language
      en: English
      de: German
      fr: French
      it: Italian
      es: Spanish
      zh: Chinese
      ja: Japanese
      pt: Portuguese
      ru: Russian
First impressions:
This program should be able to convert .html/.htm and .epub files...
it converts them to .mobi to a filesize at least double the original (depending on images and compression)
Uploaded to Kindle, all the files seem to work fine. Text formatting is kept in some way - not perfect, but readable. Kindle shows Title and author for the epub, and title set for the html (not filename!)

Seems okay, but I do not have a real chance to generate a beautiful book this way easily... maybe converting from epub might be a chance to keep the book beautiful...

...or should really read the  publishing guidelines to learn the proper formatting.

2013. december 31.

Word Wrapping inside tables on Blogger

I've had a little difficulty with one of my blogs.
I wanted to do a table with 3 columns, however, whatever I set for table with or column with it did nothing to fit the table into the required space.

Here's the solution, that worked for me:
<table style="table-layout: fixed; width: 100%;">
<tbody>
<tr><td style="word-wrap: break-word;">LongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongWord</td></tr>
</tbody></table>

2013. december 30.

DVD playback

I bought an external DVD RW today. (Samsung SE-208DB/TSBS Black)

I had to install libdvdcss to be able to playback a regular DVD Video.

And still have to use -vo gl2 to get the picture right.

Get libdvdcss
Last version of libdvdcss is 1.2.13.
Our Debian/Ubuntu repository can be accessed by adding the following content to /etc/apt/sources.list
deb http://download.videolan.org/pub/debian/stable/ /
deb-src http://download.videolan.org/pub/debian/stable/ /
And by running
wget -O - http://download.videolan.org/pub/debian/videolan-apt.asc|sudo apt-key add -
libdvdcss is available through Git or by browsing the releases.
Go to Synaptic and browse libraries (without "verse") for libdvdcss.
Source: http://www.videolan.org/developers/libdvdcss.html

To play it with Mplayer:
For the complete list of available options, please read the man page. The syntax to play a standard DVD is as follows:
mplayer dvd:// [-dvd-device ]
Example:
mplayer dvd://1 -dvd-device /dev/hdc

my command line looked like this:
 ~$ mplayer dvd://1 -dvd-device /media/DVDMEDIA/ -vo gl2

2013. december 17.

Libreoffice Functions

date to text:

this is in A1: 04/30/13
want it to look like this: 2013-04

the function is: =YEAR(A1)&"-"&TEXT(MONTH(A1),"00")