Business card parser. How to extract related information from business card recognized texts? - iphone

I have developed iphone app with OCR scanning feature.
Using Tesseract api, got the text from the image taken.
But now i need to separate each text with respect to name, address, email, phone number etc.
Because business card structure/format is not specific, its bit of difficult to assume.
However few things assume
1) "#" containing string mostly going to be email id.
2) all digits with braces or + sign mostly going to be phone number..
but still there are lots and lots of possibilities.

You will need the help of NSLInguisticTagger class .. This is your best bet or else you will have to create similar logic for each part as you stated above.

You can check the logic we used in this Javascript BCR library, also based on tesseract (the porting in js).
https://github.com/syneo-tools-gmbh/Javascript-BCR-Library

Related

OCR for business card reader in iPhone app

I was incorporating the OCR in my iPhone app using open source library "tesseract".I have seen some apps on AppStore doing so. I am just wondering how can I segregate the data that it reads from the card, i.e, how will I distinguish between say FirstName and the LastName or between CompanyName and the person's name, how will I distinguish whether the number is Phone# or the Fax# etc.
I wish that there are some standard formats of the Business Cards but I feel that would be hard luck to assume so.Any inkling on that would help a lot.
I posted it over here to gather the thoughts of various developers so that I can come up with some good logic (to make it more accurate) to classify the data that we get from the OCR engine.
Create some guesses how the various text pieces could be interpreted and let the user pick the best one. The format should be pretty standard per country (e.g. in English/German/French etc., the first name is 99.9% in front of the last name)
If now guess is good enough, the user can assign the fields himself
For the firstname/lastname problem, you could maybe consult a local file or web service with common pre-parsed names in the user's country
In order to distinguish the First Name, Last Name, Company Name, Fax or a Phone number use "Regular Expressions".
Example:
Phone - "^(\s*\d\s*){12}$"
Email - "^\w+#[a-zA-Z_]+?.[a-zA-Z]{2,3}$"
In the same way, you can find the regular expressions for other Labels in the below link.
https://www.geeksforgeeks.org/write-regular-expressions/
Thank You.

How to print a bill after swapping a credit card from Iphone?

I am coding for a project like credit card swipping and get a bill..They are using two portable printers easy to get a bill while delivery..After he enters the amount and i need to connect to the webserver and get bill for that .The bill has to be print from the portablr printers.How to get printing option from the portable printer.I searched for that and it is saying that apple will support only Hp printers. I need to get get the print what ever the printer is .Any own can share the code or Share me if any third party api is there.ThanksInAdvance .Get the print is the problem..
You have two options:
Jailbreak the device and write your own printer drives and all that "fun" stuff.
This option really isn't that great. It means you'll have gobs and gobs of extra work to do, reverse engineering the printing frameworks, figuring out what all the private API is, how to use it, what to do when things go wrong, etc. This will be hundreds of man-hours of work. I absolutely do not recommend going this route.
Use an AirPrint-enabled printer.
AirPrint is a technology that was created by Apple and is licensed for free to printer manufacturers. There are many manufacturers that are including AirPrint compatibility in their newest printers. If you're using an AirPrint printer, then printing is a simple matter of bringing up the UIPrintInteractionController and letting it do its thing. You'll need to actually generate content to print, but that can be as simple as passing a UIImage in or giving it a string of markup. If you want to do something more custom than that, you'll create a custom UIPrintPageRenderer subclass. For more information, check out Session 108 from WWDC 2011.

Less is more - auto ZIP code?

You have an international website with a form where people fill in their address.
Wouldn't it be great if people need to fill out one field less? Example:
100 visitors use the form each day
They spend 5 seconds on the ZIP code field
So 5 * 100 * 365 = 182500 seconds or 50 hours a year. And that's just for one form on one website. Multiply that by all websites that ask such information and you can see the time we can save by redesigning this.
You can get someone's ZIP code via geolocation + geocoding. But since a person's current position can easily differ from the city a person lives in, this isn't really usable.
A solution would be to get the ZIP code based on a geolocated (but changeable) country, input city and input street.
The API we could use: http://code.google.com/intl/nl/apis/maps/documentation/geocoding/ or http://developer.yahoo.com/geo/placefinder/.
Now the real question is, which problems would arise (internationalization, localization, accuracy, etc.)?
No-one else has answered this, so I'll have a go.
No, it wouldn't be great if the website filled in the zip code field based on other information. It might work for some people. It would certainly fail for enough people that you'd have to offer a zip code field as an override. Now you have a site with a higher complexity and development cost than one with a conventional zip code field, because you have to test both the automatic zip code guesser and the conventional field.
You'll have a usability hit which comes from people being confused by the two alternatives and not knowing which to choose.
You'll pay an opportunity cost, by spending design and development resources on the zip code guesser, instead of on some other feature which yields a larger usability benefit.
Here are some problems I foresee arising:
Inaccuracy: whatever mechanism you use collects correct hints (IP address location, street address and city) but generates the wrong zip code, due to errors
Remote use: Users entering a different address than their current location, e.g. using a computer at a hotel in a different country to fill out a form related to their home address, so location of IP address of computer is different from location of address in form
Localisation failure: whatever mechanism you use doesn't work with the hints of the user's address, e.g. different address conventions in a foreign country
Provider business terms: you want to use a geocoding service like Google's or Yahoo's APIs, but the license agreement for that service isn't compatible with the business model of your site. For example, they want you to pay if you are geocoding for commercial purposes, or for a site behind a firewall, or more than a certain number of transactions a day
Change in provider situation: you use an external geocoding service, and it goes out of business
etc.
Before taking on a feature like this, I'd take two steps:
User research. Can you identify users for whom the time taken to enter a zip code is a pain point? What about the one of the top three pain points? I'll bet this issue isn't even on your users radar.
Test on existing data. For whatever method you are thinking about using to guess zip code, try it on existing customer data, and see if you can accurately reproduce the zip code the customer entered. This will give you an idea of your error rate. Can you live with this error rate?
If your real question is, could someone please validate my feeling that this is a charming feature, then I probably haven't given you the answer you seek. But you asked, "what problems would arise?"

Clickable email-links encryption? How to do them?

I would like to know if and how it is possible to create a clickable email-link for websites, that are "encrypted" in a way emailspiders can't collect them and it is still possible for living users to click it to open in email-clients or even copy it.
I saw some links that were done in javascript but I on't know how they did this and how "safe" they are.
thank you in advance for any reply
Most approaches to this are splitting the address across multiple elements and inserting extra formatting; then for JS-enabled browsers, they use JavaScript to turn it back into an e-mail address.
The poster example for this is SpamSpan, which even has several "levels" of obfuscation - each level progressively less and less resembles an e-mail in the source code, yet it still manages to piece it back together by JS. Although some spambots today are supposedly capable of executing JavaScript, te vast majority doesn't - and the e-mails are still human-readable with JS off. An advantage of JS-assisted de/obfuscation is that it doesn't rely on external servers, you just need to (simply) integrate the JS library.
Another approach is taken by reCAPTCHA Mailhide - the e-mail is revealed only after solving a CAPTCHA (same type as for normal reCAPTCHA). This is less convenient for the user, but practically safe against robots. A disadvantage of this is that it depends on reCAPTCHA's servers (in essence, on Google) - some people are dead-set against any external dependencies.
This would be a very simple and effective way:
Scramble email addresses
All it does is convert it into ASCII, and all you need to do is insert it where your email address would go!
Although there are more (crazily) secure ways you can choose, this would be the simply option. You can also try this solution, it uses JavaScript to protect your email.
Hope this helps!

Programmatically Fax from Internet form

I'm new to programming, and my only area of expertise is web design/simple development on platforms like wordpress/expression engine. (Yea, you guys can laugh).
I have a new client who currently receives medical faxes through an online form (the user fills out a form concerning their prescriptions and once submitted, it faxes the info).
I'm completely redesigning their site, and I'm not sure how online faxing works.
Has anybody dealt with internet faxing? How does it work? Does/can it go through email?
And is it possible to send a fax through a form with javascript/php or route it through email?
Don't pay for it! All you need is a modem on the server and a standard phone line. Then set up a fax print driver under your os (you can do it on windows and unix).
The unix way is mgetty/sendfax : http://mgetty.greenie.net/doc/mgetty_3.html#SEC3
The Windows way : http://support.microsoft.com/kb/306657
There are other ways but unless you can't get a phone line you'd be mad to pay fees for it.
Would it not be helpful to look at how it is currently being done, that way you can learn a thing or two about the process before trying to go do it again? That way you can find if it is using any special libraries or techniques or services to send the fax and you can then either duplicate the code or use it as a template to get started on your own solution.
All of what your asking is possible. I would recommend finding a service provider who can send the fax for you. They all have different interfaces requirements and pricing. I used to use DataOnCall which is now called Fax.com
They had a web service which we would post the document to be faxed plus additional information. They were a preety reasonable service. This was several years ago so I can't speak how they currently fair.
Take a look at eFax's SDK. I haven't used it, but it looks like it might be useful to you.
Yes, you can send faxes via email through several services; this link seems to have some useful information. I worked at a company previously that did this same sort of thing, and while I don't recall the exact service we used, most of them are very similar, and they work reasonably well.