View Single Post
Old 01-02-2014, 11:36 AM   #51
spitfire_ch
Enthusiast
spitfire_ch began at the beginning.
 
Posts: 28
Karma: 10
Join Date: May 2012
Device: Sony PRS-T1
Quote:
Originally Posted by davidfor View Post
I have been remiss...

The new version of the plugin is working well. And I have a working class for the Kobo devices. It just needs a little more testing. If there is a willing guinea pig out there, please contact me.
I don't have a kobo - hence I don't qualify as guinea pig. However, I am highly interested in your class for the Kobo devices. I am still trying to wrap my head around Sony annotations, and from what I have seen somewhere else, Sony and Kobo might use the same or at least a similar system to store annotations. Sony uses something similar to a canonical fragment identifier:
text/part0000_split_005.html#point(/1/4/9:2) (one position before the beginning of the highlight)
text/part0000_split_005.html#point(/1/4/10/1:1) (end of highlight)

Nook must use something alike:
https://www.mobileread.com/forums/showthread.php?t=99000
Quote:
Originally Posted by Reader2
Most of these are about 6/700 bytes but annotated are must bigger and contain things like:
#point(/1/4/150/5:3)
Looks the same to me

I already partially figured out how this works:
/1 indicates the root element (<html...)
even numbers navigate through the elements. So 2 is the first child of the root (<head...), 4 is the second child of the root (<body...), /1/4/10/ is the 5th child of the body (usually the 5th paragraph or header).
: idicates the offset within the element.

However, I am not quite sure what odd numbers mean. They usually occur if the highlight starts at the beginning of the paragraph. So the position before the highlight is "between the paragraphs". But in case of /1/4/9:2 --> what's the second character of "between paragraph 4 and 5? Do you happen to know that, by chance?

So, I am almost there, but not quite. I was hoping that looking at your code might help me to figure out the remaining gaps - and also give me an idea to write code to navigate using this kind of identifiers.

Thank you very much for any ideas - or the code ...
... and of course all the very best in 2014!!

- spitfire
spitfire_ch is offline