How can I use TesseractOCRiOS with Spanish? - ios

Of course I added the relevant Spanish files and I initialized it like this: G8Tesseract(language: "spa"); but it just keeps giving me the same error (which isn't even very clear). In English it works just fine, by the way; it's probably an issue with the data files, but I couldn't find more of them. Any ideas or something?:(

You are using the wrong data file. Tesseract for iOS doesn't support Tesseract's last version. You must look for the TESSERDATA files for version 3.02. If you use newer files you get that error.
Take the files for Tesseract ver. 3.02 from here: tesserdata files. At the bottom of the page you'll find the files to download.
Test it in Tesseract-only mode. CUBE doesn't always work with non English languages.

Related

Xcode 9.2 crashes exporting or importing xliff

I can see that this is a recurring problem with all sorts of Xcode versions. I'm using the latest non-beta build (9.2 9C40b).
I have already localized in Spanish. Doing that involved successful exports and imports of xliff files, with same Xcode. So what changed?
I am now trying to localize to another language. This is a showstopper. Any hints? I have looked through all the posts about previous versions crashing, and have not found anything that works.
(And before you mention it, I am done and over with genstrings. If it exists anymore.)
I've discovered that large .xliff files (more than about 6,500 lines or 1,200 <trans-unit> elements) cause Xcode 10.1 to crash consistently near the end of an import operation.
The work-around is to manually split the .xliff file into two distinct .xliff files, each containing a subset of the <file> elements in the original file. You can then import the two resulting .xliff files into Xcode separately without crashing.
Do not translate "bundle name"
I wanted to translate to Greek Language and every time I was importing xliff files, Xcode was crashing.
I realized that the problem was, that I was also translating "bundle name".
If you did the same mistake, open xliff file, find:
<trans-unit id="CFBundleName">
<source>NameOfYourApp</source>
and delete the line
<target>...</target>
After that everything worked perfect for me!
Here's a workaround. Select your project icon in the Project Navigator. Select Info at top (as opposed to Build Settings). Under Localizations, click the + button and add your new language.
Xcode will create the new .strings files and fill them up with pre-existing translations. (If there are any.) Strangely, for me, some of the new .strings files were filled in with English, some with Spanish.
In any case, you have the new .strings files and can manually paste in the translations for the new language. If your app doesn't have too much user-facing text, this isn't onerous.
But really, with this problem going back to Xcode 4 (!) one would think it would be fixed by now.
it's a late answer I know, and I'm using Xcode Version 10.1 (10B61) already.
In my scenario, I added Chinese Hong Kong (zh-HK) language under Project > Info > Localization and exported successfully then sent to the agency for translations. After few days they sent to me Chinese translated text within. At that point, everything seems correct for me by eye. But I've tried 10 times to import file and it crashes 10 times without exception! Which makes me sick. I use to checked to see the difference between 2 document via Apple's File Merge App. I understand that agency geniuses added few missing <\target> tags. Hmmm, that means while exporting Xcode didn't add for some translations <\target> tag. Interesting...
I removed those unnecessarily translated tags and checked everything was equal in 2 documents except translations of the words to the Chinese language.
Tried to import again. Then BOOM! It works like a charm! I was surprised by this. It's so weird that Xcode never shows me a descriptive message about my mistake. Probably, It's just a parse error for Xcode.
Whatever, I hope this will work for someone else.
Best.

List of possible emojis for Twitter

When using the Twitter API you get emojis as unicode characters. You can then easily parse out and display emojis as pictures. One example of such a parsing tool is Twemoji, which is the official emoji parsing tool from Twitter. In the twemoji.js file there is a long regular expression they use to parse out the emojis.
However, this file has not been updated in two years, and there are many emojis missing from Twemoji that are displayed just fine on twitter.com.
Does anybody know of any other well maintained list of current emojis supported by twitter.com? A bonus would be that they use/provide a regular expression I can import into my own code.
Twemoji has a somewhat weird structure on Github due to a CDN mirroring, which means that when Twemoji releases a new version, or updates the regular expression in newer versions, the original versions will still be there.
The twemoji.js file on the front page is indeed an old version. However, they have released newer versions, so on the root of the project there is currently a folder named 2. This file contains a twemoji.js that is much newer than the one at the root level. The regex in this file catches all emojis currently displayed on twitter.com.
So when getting a new regex for your app, remember to not check the root folder, but look for a numerical folder which contain newer versions.

Pass app to Xcode

I've been running a Xcode project on my iPhone but I haven't upload the binary yet. The thing is that I've lost the code on my Mac (that's what happens when you don't commit con GitHub) and the only thing I still have from the project code is the "app" that the iPhone saved when I run it for the first time. Is there any way to pass the code from the iPhone or see the code?
No. Your code was compiled, linked and packaged to produce the application, and it is the resulting compiled binary that has been installed on your phone.
You may be able to retrieve resources (storyboards, XIBs, images, plists...). For the code, there may be decompilers (not sure if there are any for Objective-C or Swift, though), but they will not reproduce your original code, just code that compiles to the same thing (i.e. without comments, with arbitrary names for local and instance variables, etc.).
Don't you have a Time Machine backup of your project?

weird encoding in ios executable file of an app

I'm trying to see how does certain ios apps executable files look like, what i do is export the app files to my computer using iexplorer, i then took a look at the info.plist to see the executable files, after that i opened them with my notepad to use the UTF - 8 Encoding, but here how does things look like in both files-in the opening of both of the files i see english words that are expressing directories:
sample of file 1:
‹"Ò.(?!ÑNÓU£C°îXjøe”Ú5O•½°{^ÿÝŒEÌrôðæ$#[3,ÔÜ£æ»8I˜hGw!*aHÒQ•tœl²þ„™AÍçßÍ憴³)è:cÌ7H5æß-eFç¯î&Ø\n,$Ë$y»¥ÁB^6ÙP; i(q,AÅ
âðð·'©=Ÿa"v!PBÛÚ"¤¬‹Wj·;ËsÌŽÚâZüŠ–ÇüÉ;ÜA´sI«¸Üæ¿÷ ›‚‰.êøLž
sample of file 2:
ßꪧgö«húDªÝn¡±CÅÁ¹ â=؉ˆ4|®b¡ JeW-ɯðó¦xgýgeéÀXœH7ßJÉ" 3‡rÜ6ÒI_ ƒr cdÅá¸|íð¼l;Töl±”›MÛ˜±o/ôÇô#¬RS;Y¥!ÜzGò“vî©6ØR¡‚>Ì0m5
ŸzrPÐiDMÊ|Þ·9âëYß,p؃‹£x—.àN5îüÝrjœG]Æ·
ironically in the second file i can see a huge block of english words absolutely fine, but i dont get it why i don't see the whole file very good? i have also tried to open the files in an objective-c compiler after i have made them .m but that again was useless???
The executable files contain machine langage (binary) and cannot easily be read or understand by human. The word you still see in english are probably comments left by compiler that are not executed.
Trying to open those files in a compiler won't work because if the compiler role is to convert objective-c in machine langage, he's not able to convert the other way. For a same set of machine instructions, there are many ways to code it in objective-c.
The only way to get a source-code from a binary executable is to do some retro-engineering. It is done by converting the binary executable in assembly langage (it's a very low level langage but with understandable syntax) and then trying to reproduce the instructions with a higher-level langage such as objective-C.

AS3 Multiple Application Domain using local null.swf file

I have the following issue, I cannot find a solution on the web, please let me know if you can help me or point me to a proper info about this issue.
To understand the background, Im porting a game from flashDevelop to Flash Builder (please dont give me tips about this comment if doesn't help to my particular problem). Everything works fine right now, the game use a file null.swf as a container of local files (I don't undertand that part completely, but the game has a lot of embed swc files, and the game use the null.swf to access those files, through LoaderMax).
The problem is that everything works fine with a fast build, but it's not working with a standard build, I have the error on Loader class that says "Multiple application domains are not supported on this operating system".
Useful information:
Im using AIR 3.9, compilation flash swf-version=20 (I had 18 when I started with this issue)
null.swf is properly included on the IPA, the code recognize the file, and as I said before it works with a fast build.
For embed swc files, I had to include the files with a compiler argument: "-include-libraries ../../filename.swc ../../filename2.swc etc.."
Thanks for any help.
Regards
It's fixed, using a context:
context = new LoaderContext(false, ApplicationDomain.currentDomain, null);
If I use the third parameter, like ..., SecurityDomain.currentDomain); it doesn't work.

Resources