Comments (5)
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.
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.
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.
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.
no worries, good luck! ❤️
from go-astisub.
Related Issues (20)
- clean up go.sum
- func formatDuration has a bug will to output wrong result HOT 4
- Add support for linear correction HOT 2
- DVD Studio Pro reader and writer
- iTunes Timed Text reader and writer
- not support .ass file? HOT 4
- Populate originalEpisodeTitle and originalProgramTitle for STL file convertion HOT 4
- Can go-astisub parse HDMV/PGS subtitle? HOT 1
- convert ass subtitle contains more than one language to vtt fail HOT 6
- Can't change fontColor for STL file HOT 2
- TTML text parsing issues with new lines HOT 1
- Support AddItem(s) and RemoveItem(s) HOT 2
- Handle dot as well for SRT files HOT 1
- Subtitles.go String() - why are subtitle lines joined with a " - ", instead of a new line ("\n")? HOT 3
- Escape problem when convert from other formats to VTT, and from VTT to other formats HOT 11
- Example usage ReadFromSRT in the README is incorrect HOT 4
- Broken VTT styling in output (0.26.0 only) HOT 3
- The indexes always are zero (v0.26.1 only) HOT 2
- Timestamp tag regression in 0.26.0 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-astisub.