Is there a good machine-readable thesaurus? - thesaurus

Is there a good machine-readable thesaurus that's free to download and use? We need to be able to canonicalise input into our app so that if we already have a record for 'what time is dinner' and the user adds 'when is dinner' we don't get a new record.

Hunspell includes a thesaurus library called MyThes. You can use that (or just the data files if you want to roll your own). If you're using .NET you can use NHunspell which is the same as Hunspell but for .NET. You should be able to get some good use out of that.

Related

How do I add new strings to iOS app for localization?

I have localized my app and set up the Localization.string file.
Now that I want to add new strings, how do I make it so the corresponding files get the new strings automatically? Or do I have to manually add them?
Just not sure how I should organize my translators to be able to see that there are new strings to translate without having to just keep track of it manually.
I don't think there is an automatic way to manage them.
What we do is add a "//New" or "//Changed" to the end the english resource string, and our translators remove it when they add the other umpteen versions.
We actually put a \ tag with the date the item was added in order to let the translators know what is new and when it was added.
Another thing that we do is leverage a tool which auto translates our English localizable.strings files into target languages using Google's api service. While Google's translations aren't perfect, they are a great start for our translators. This really jumpstarted our translation process. Link to Apple Store app.

Access adobe digital editions from the command line

I'm looking to create a script for my 80-year old grandmother that downloads the books she needs, and converts them using the command-line version of Calibre, to kindle format so she can read them on her kindle. She gets a lot of her books from a service in the form of Adobe .epub books. AFAIK, none of these books have DRM on them prior to being converted, so let me be clear - I'm not asking how to strip DRM from an ebook.
What I am asking is whether there is a way to programmatically (from the command line is fine if Adobe Digital Editions supports CL args) use the ticket file to request a book from the library, and download it, in .epub form, to the local hard drive. I simply don't want my grandmother to have to go through all of the unneeded screens in Adobe Digital Editions' interface - she gets confused easily, and the interface tends to be overwhelming for her. I simply want to write a function (it can be a system() call to a command... that's fine) that will allow her to take a file received from the library or digital service and automatically retrieve the proper .epub file.
I have all of the other steps ready to go... I just can't find any way to retrieve the book from the service without using the DE interface.
Any suggestions?
Check this S.O. posting, I know it will help ;-)
pdf-adobe-digital-edition

Is there a way to run a script on iOS?

I need to define a processing rule for web data in iOS and thought it would be a good idea to pull the processing rule as a script file from my server and execute it on the iOS device, since the web API I'm interacting with might change URLs or response syntax and I need to be able to fix such issues fast and cannot rely on pushing an update (takes forever).
I wanted to do it with a small JS file that is pulled from my server every once and a while, but unfortunately iOS doesn't include the JavaScriptCore framework.
Are there other options?
Apple developer agreement will not let you run a downloaded, interpreted script, on the device.
Your best bet is probably downloading a data structure (potentially in JSON format) and parse that and take some predefined actions in your client code based on that, rather than trying to execute the downloaded code directly.
You can let a UIWebView run a Javascript snippet, or you could use another scripting language like LUA (don't forget to add LUA for this). The real problem is: You are not allowed to download code from a webserver or somewhere else. Everything must either be already on the device, or calculated at runtime.
Depending on the information that you want, you could use an XML file that includes the new URLs and parse it, but I don't know if this fits your need.
You can compile JavaScriptCore into your app, evidently, and have it approved by Apple. However, as Mehrdad notes, any scripts run in the app must already be in the app at the time the app is reviewed.

Options to create editable graph or scheme with Perl?

I'm searching for a way to create complex/simple graph using Perl.
The known modules/applications I've checked are: GraphViz, Graph-Easy, aiSee etc.
Each way I walked, new problems appeared.
If my need is to create graph dependencies that
can be edited live
have a directed compass mode
work fine and are readable with massive data use
can be used through the terminal to convert from input format (GDL etc.) to output format (PNG, BMP, HTML etc.) –
what are the various applications that can handle all of these requests?
This question is a follow-up of How can I convert connection data lines to block of schemes using Perl?.
Thanks,
YoDar.
It might be an overkill for your application, but you might also want to look into PerlMagik.

Own data format for the iPhone

I would like to create my own data format for an iPhone app. The files should be similar structured as e.g. Apple's iWork files (.pages). That means, I have a folder with some files in it:
The file 'Juicy.fruit' contains:
Fruits
---> Apple.xml
---> Banana.xml
---> Pear.xml
---> PreviewPicture.png
This folder "Fruits" should be packed in a handy file 'Juicy.fruit'. Compression isn't necessary. How could I achieve this? I've discovered some open source ZIP-libraries. However, I would like to to build my own data format with the iPhones built-in libs (if possible).
Best regards,
Stefan
Okay, so there are three ways I am reading your question, here's my best guess on each one:
You want your .fruit files to be associated with your app via Safari/SMS/some network connection (aka when someone wants to download files made for your app or made by your app).
In this case, you can register a protocol for your app, as discussed here:
iPhone file extension app association
You want the iPhone to globally associate .fruit files with your app, in which case you want to look into Uniform Type Identifiers. Basically, you set up this association in your installer's info.plst file.
You want to know how you can go from having a folder with files in it to that folder being a single file (package) with your .fruit extension.
If that's the case, there are many options out there and I don't see a purpose in rolling your own. Both Microsoft and Adobe simply use a standard zip compression method and use their own extension (instead of .zip). If you drop any office 2007 document, such as docx or Adobe's experimental .pdfxml file into an archive utility (I like 7z, but any descent one will do), you will get a folder with several xml files, just like you're describing for your situation. (This is also how Java's jar file type works, fyi). So unless you have a great reason to avoid standard compression methods (I vote gzip), I would follow the industry lead on this one.
I can definitly appreciate the urge to go DIY at every level possible, but you're basically asking (if it's #3) how you can create your own packaging algorithm, and after reading how some of the most basic compression methods work, I would leave that one alone. Plus I really doubt that Apple has built in libraries for doing something that most people will just use standard methods for.
One last note:
If you are really gunning to do it from scratch (still suggest not), since your files are all XML, you could just create a new XML file that will act as a wrapper of sorts, and have each file go into that wrapper file. But this would be really redundant when it came time to unwrap, as it would have to load the whole file every time. But it would be something like:
Juicy.fruit --
<fruit-wrapper>
<fruit>
<apple>
... content from apple.xml
</apple>
</fruit>
<fruit>
<banana>
... content from banana.xml
</banana>
</fruit>
<fruit>
<pear>
... content from pear.xml
</pear>
</fruit>
<picture>
...URL-encoded binary of preview picture
</picture>
</fruit-wrapper>
But with this idea, you either have to choose to unpack it, and thus risk losing track of the files, overwriting some but not all, etc etc, or you always treat it like one big file, in which case, unlike with archives, you have to load all of the data each time to pull anything out, instead of just pulling the file you want from the archive.
But it could work, if you're determined.
Also, if you are interested, there is a transfer protocol intended specifically for XML over mobile called WBXML (Wap Binary XML). Not sure if it is still taken seriously, but if there is an iPhone library for it, you should research it.