Cloud Vision API - Space as a number separator - google-cloud-vision

What to do to prevent text detection from dividing digits with a space into two frames?
For example: "1 200.00" is divided into "1" and "200.00".

It sounds you want to set custom separator to the text_detection mode, it's not possible as far as I know.
Even if it was possible all the words separated by space would be read as one word?
You can parse the json response and manipulate it as you wish.
Here is the structure of the response

Related

Google OCR: Special Characters Affecting OCR Number Recognition

I've been playing around with Google's OCR recently using the default tutorial and was trying to parse numbers. I've seen previous issues dealing with numbers on license plates, but was wondering if there was a solution when special characters affect the results of OCR. Most notably, including the '#' character with a number, such as #1, #2, etc as shown below results in the output ##Z#T# and even occasionally gives me Chinese characters even after I set the language to/from settings to English.
Numbers with pound sign
For a similar comparison, the image below is easily read by the OCR:
Numbers without pound sign
Is there a setting that I'm missing that can improve the results or is this just a constraint by the model?

R Dataframe - add a newline or whitespace bewtween two strings

I have a data frame containing two columns, let's call them "description" and "closure_notes". Basically what I am trying to do is combine the contents of both of those columns into a single one (replacing the contents of "description" with the merged contents of the two). The trick is, I need there to a blank line or two between the two pieces of data.
For instances, if df$description is, "A short descriptions of the issue", and df$closure_notes is, "Solved (Workaround): Fixed issue by restarting services", then the result I want as the new value for df$description should be:
A short description of the issue
Solved (Workaround): Fixed issue by restarting services
The reason for the space is for readability. This data will be eventually shown in a shiny app and an accompanying PDF report that can be generated vi knitr/rmarkdown. I want the space in there so when someone reads this they can easily jump right to the closure notes if they want to, but they want them combined into a single column. I have tried paste with several "\n\n" as a separator, tried using writeLines and cat, which work great, printing to the screen, but I want something that will write the result back to the data frame. I am looping through each row combining these two columns, I just need that blank line separating the two pieces of data. Any suggestions? Thanks in advance!
Shiny deals with HTML tags. Therefore try using < /br> and not \n\n

In Qualtrics, what are the limits on field names?

I've never used Qualtrics myself and do not need to, but my company receives Qualtrics-generated CSV data from another company, and we have to advise them about the names to use for fields/variables, such as "mobilephone".
The main thing I need to know is the maximum number of characters, but other limits (such as special characters to avoid) would be helpful. For example, would profile_field_twenty6chars be good? (The data is going into Moodle, which uses profile_field).
Qualtrics has 2 different limitations to my knowledge.
Question names are limited to 10 characters(absurd in my opinion)
Question Export tags (this defaults to the question text, and is shown on the second row for csv datasets) has a limit of 200 characters.

How to GS1 parse 01.10.17.21?

I have some products which have 2d GS1 bar codes on them. Most have the format 01.17.10 which is GTIN.Expiry Date.Lot Number.
This makes sense as 01 and 17 are fixed length, so can be parsed easily, just by splitting the string in the appropriate place.
However, I also have some in the format 01.10.17.21 (GTIN.Lot.Expiry.Serial Number) which doesn't make sense because Lot and Serial number are variable length, meaning I cannot use position to decode the various elements. Also, I cannot search for the AIs as they could legitimately appear in the data.
It seems that I've no way of reliably decoding this format. Am I missing something?
Thanks!
According to the GS 1 website, "More than one AI can be carried in one bar code. When this happens, AIs with a fixed length data content (e.g., SSCC has a fixed length of 18 digits) are placed at the beginning and AI with variable lengths are placed at the end. If more than one variable length AI is placed in one bar code, then a special "function" character is used to tell the scanner system when one ends and the other one starts."
So it looks like they intend for you to order your AIs with the fixed width identifiers first. Then separate the variable-width fields with a function character, which it, appears is FNC1, but implementing that that will depend on the barcode symbology you are using, It may be different between DataMatrix, Code 128 and QR Code for example.

Convert number into words using flex

I am trying to convert an entry using a numeric stepper in flex into words to display in a textarea.
i.e a user uses the stepper to enter "89" as a value and in the text area the words "Eighty nine" are displayed.
After much searching i haven't found anything that helps - a few javascript functions but that is all.
any help sample code would be much appreciated.
thanks in advance.
I would suggest you make a hash table with the numbers "0" to "99" as indices (enclosed in quotes) and the values being the word names for those numbers. That will make localization possible without out a lot of complicated code to determine, for example, the difference between "eleven" and "juu ichi" (ten one) in Japanese or between "ninety-nine" and "quatre vingt dix neuf" (eighty-nineteen) in French, "twenty-two" and "zwei und zwanzig" (two and twenty) in German, etc.
Let's name that hash table myNumberWords. Then you would simply convert your digits as follows:
function getWordsFromNumber(num:Number) : String {
return myNumberWords[num.toString()];
}
If you want to go higher than 99, add a hash for the words hundred, thousand, million, billion, etc., then split your whole number into an array and place the appropriate units after every 3rd number, counting from the top of the stack. You'll also have to have zero values and double-zero values counted as empty strings ("") except when there is only one digit and it is a zero, etc.

Resources