Giter VIP home page Giter VIP logo

Comments (5)

asticode avatar asticode commented on May 25, 2024

To be honest you shouldn't have to worry which format can be parsed by this lib as it should be able to parse all formats. Unfortunately it doesn't right now. The only common pattern between your 3 examples is that structure : body > div > p.

Right now here's what is missing:

  • parse body attributes
  • parse first div attributes
  • for each p, really parse the exact xml + attributes inside it

I'm welcoming PRs.

Cheers

from go-astisub.

shlompy avatar shlompy commented on May 25, 2024

Thanks..
I just wonder if the subtitles can also have different structures which I haven't faced yet (e.g. body->div->div->div->p)..
Also, correct me if I'm wrong, but it seems to me styles are not inherited currently, and eventually a subtitle item holds only the inline style, and the style id of that item for another style... Not traversing up the nodes to inherit all parent styles...

Not sure if I'll succeed with adding such changes to a PR, I also need to support TTML with subtitles which have a bit of different body, and probably doesn't suit this package is used for conversion of other formats which do not support images...

I still wonder if it will be easier for me to enhance this package or do something from scratch, probably with xpath which might make nodes traversals easier than mapping to structs with xml tags...

from go-astisub.

asticode avatar asticode commented on May 25, 2024

If I were you, I would enhance this package but I guess I'm biased 😄 Using xpath instead of standard go xml unmarshaling could be a good idea and, if implemented correctly, could handle all types of bodies.

If you decide to enhance this package, let me know, I'll try to point to the right direction 👍

from go-astisub.

shlompy avatar shlompy commented on May 25, 2024

Thanks Renard
I think I'll pass enhancing this package, might be too expensive for me to refactor it, and probably to expensive for me to use it as I only need to parsing part for converting to proprietary format which should be on server side serving +100k clients... Need this to slimmed down and more efficient... But I should defiantly use it as a reference to understand how to parse the text properly...

from go-astisub.

asticode avatar asticode commented on May 25, 2024

no worries, good luck! ❤️

from go-astisub.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.