0

I am new in this field and I apologize from the start if there will be any mistakes, I hope I will be able to expose the problem.

I want to use Quick's, draw! dataset for a project on Tableau.

Each file contains elements: key_id, word, recognized, timestamp, countrycode and drawing.

Drawing is a a JSON array representing the vector drawing, and Tableau doesn't read it.

{ 
"key_id":"5891796615823360",
"word":"nose",
"countrycode":"AE",
"timestamp":"2017-03-01 20:41:36.70725 UTC",
"recognized":true,
"drawing":[[[129,128,129,129,130,130,131,132,132,133,133,133,133,...]]]
}

The format of the drawing array is as following:

[  // First stroke 
[x0, x1, x2, x3, ...],
[y0, y1, y2, y3, ...],
[t0, t1, t2, t3, ...]
],

[  // Second stroke
[x0, x1, x2, x3, ...],
[y0, y1, y2, y3, ...],
[t0, t1, t2, t3, ...]
],

Where x and y are the pixel coordinates, and t is the time in milliseconds since the first point. x and y are real-valued while t is an integer. The raw drawings can have vastly different bounding boxes and number of points due to the different devices used for display and input.

My question is: Is there a program or a way to count the lines that have been drawn for each drawing?

Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
  • Show the relevant `C` code in the form of a [mcve]. _Is there a program or a way to count the lines that have been drawn for each drawing?_ Yes, there is a way, but if you have not tried yet, try. Then if you have a problem with what you tried, then post it. – ryyker Aug 14 '20 at 13:43
  • If the data for drawing is on one line count the number of comma for it then divide by 3. If on several bypass the lines with other keyword first then count the number of comma then divide by 3. Can be done using *grep* or *awk* – bruno Aug 14 '20 at 13:45
  • @bruno - `grep` and `AWK` assume Linux. ( no reference to OS here, but `quickdraw` implies apple OS) – ryyker Aug 14 '20 at 13:47
  • @ryyker is it possible to work out of Linux/Unix ? ... ok easy joke. But under Windows you know it is possible to have them. And BTW I never said only *sed* and *awk* can do that ;-) – bruno Aug 14 '20 at 13:48
  • 1
    @bruno - actually I did not. I used them in UX systems all the time, great tools, but have not used them on Windows. But I think OP is using something from Apple anyway :) – ryyker Aug 14 '20 at 13:50
  • @ryyker yes I think too because of QuickDraw – bruno Aug 14 '20 at 13:50

0 Answers0