Thread View: news.software.nntp
5 messages
5 total messages
Started by sebhoff2002
Wed, 01 Jun 2005 14:37
Another question ;-) Line wrapping...
Author: sebhoff2002
Date: Wed, 01 Jun 2005 14:37
Date: Wed, 01 Jun 2005 14:37
26 lines
2064 bytes
2064 bytes
OK - here's another question: I'm trying to make sense of how different newsreaders deal with line wrapping. And how to undo it... What I would ultimately like to do is write a Perl script that will allow me to "repair" those wraps all the way down the hierarchy of a thread. As long as no line wrapping occurs, it's of course no problem to allocate quoted text properly. But then there are things like the following: >>>>>>>>>>>>>>>Are you giving 'props' to Gary? >>>>>>>>>>>>>> >>>>>>>>>>>>>>Yo!!! Give Gary Burnore a chance to defend himself! I'm sure >>>>>he'll be >>>>>>>>>>>>>>back soon. He's probably out sniffing bicycle seats!!!! >>>>>>>>>>>>>> >>>>>>>>>>>>>>:-) Does anybody know of any efforts that have been made to sort out this type of mess? I can think of a number of dirty hacks to could offer partial solutions - but I thought I'd ask first. ;-) Thanks in advance for any input! Sebastian
Re: Another question ;-) Line wrapping...
Author: Szymon Sokół
Date: Wed, 01 Jun 2005 20:39
Date: Wed, 01 Jun 2005 20:39
26 lines
2422 bytes
2422 bytes
sebhoff2002@yahoo.com wrote: > >>>>>>>>>>>>>>>Are you giving 'props' to Gary? > >>>>>>>>>>>>>> > >>>>>>>>>>>>>>Yo!!! Give Gary Burnore a chance to defend himself! I'm > sure > >>>>>he'll be > >>>>>>>>>>>>>>back soon. He's probably out sniffing bicycle seats!!!! > >>>>>>>>>>>>>> > >>>>>>>>>>>>>>:-) > Does anybody know of any efforts that have been made to sort out this > type of mess? I can think of a number of dirty hacks to could offer > partial solutions - but I thought I'd ask first. ;-) Without utilizing Artificial Intelligence you cannot distinguish between wrapped line and inserted text - in the example above, "sure" might be either one. Comparing the body to the previous article in thread could help, but then you would have to create a pretty complicated algorithm to deal with omissions. -- Szymon Sokół (SS316-RIPE) -- Network Manager B Computer Center, AGH - University of Science and Technology, Cracow, Poland O http://home.agh.edu.pl/szymon/ PGP key id: RSA: 0x2ABE016B, DSS: 0xF9289982 F Free speech includes the right not to listen, if not interested -- Heinlein H
Re: Another question ;-) Line wrapping...
Author: sebhoff2002
Date: Thu, 02 Jun 2005 05:47
Date: Thu, 02 Jun 2005 05:47
12 lines
1964 bytes
1964 bytes
Yes - that's what I'm currently planning to do. It won't be 100% accurate - but I guess it's better than nothing. I'll try to isolate what looks like a block of quoted text in a message and then check (word by word or character by character) whether this matches a stretch of text in the message to which it replies. I'll then save the "cleaned up" version and use it for the same kind of procedure one level down, if necessary. Omissions should not be a major problem as long as I can isolate them with reasonable precision. I can think of a whole range of ways in which this can mess up - but I may get 90-95 per cent of things right. And that should be sufficient for what I need. Sebastian
Re: Another question ;-) Line wrapping...
Author: Curt Welch
Date: Fri, 03 Jun 2005 20:20
Date: Fri, 03 Jun 2005 20:20
27 lines
2590 bytes
2590 bytes
sebhoff2002@yahoo.com wrote: > Yes - that's what I'm currently planning to do. It won't be 100% > accurate - but I guess it's better than nothing. I'll try to isolate > what looks like a block of quoted text in a message and then check > (word by word or character by character) whether this matches a stretch > of text in the message to which it replies. I'll then save the "cleaned > up" version and use it for the same kind of procedure one level down, > if necessary. Omissions should not be a major problem as long as I can > isolate them with reasonable precision. I can think of a whole range of > ways in which this can mess up - but I may get 90-95 per cent of things > right. And that should be sufficient for what I need. > Sebastian For normal news software, no one has to write the code you are trying to create, so it's not a problem that has been delt with. All that normal news softare ever does is try to figure out which lines match up with which other lines in the same post so they can be re-wrapped correctly - but that is done simply by counting indent markers and assuming they are consistent (which of course is not always the case). But when they are not consistent, the line wraping code doesn't make it much worse so it's just not a problem that has been addressed. Good luck... -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com http://NewsReader.Com/
Update
Author: sebhoff2002
Date: Mon, 06 Jun 2005 13:33
Date: Mon, 06 Jun 2005 13:33
32 lines
2813 bytes
2813 bytes
Curt Welch schrieb: > For normal news software, no one has to write the code you are trying to > create, so it's not a problem that has been delt with. All that normal > news softare ever does is try to figure out which lines match up with which > other lines in the same post so they can be re-wrapped correctly - but that > is done simply by counting indent markers and assuming they are consistent > (which of course is not always the case). But when they are not > consistent, the line wraping code doesn't make it much worse so it's just > not a problem that has been addressed. > > Good luck... > Thanks for confirming my hunch that nothing of this sort has been done before... ;-) A quick update: I've now written a script that starts at root level and recursively works through all follow-up postings of a thread. It manages to assign about 99% of all quoted lines to previous posts and keeps track of things with some sort of pseudo-SGML-tags (and saves the converted text into a MySQL database). For a group like news.software.nntp, roughly between 2 and 7 per cent of all postings of a particular level contain lines that cannot be assigned. I haven't checked how many per cent of all threads are completely "clean" - but I suspect that it's not too bad. Sebastian PS: And yes, my script correctly assigns the split quote shown in my original posting - although it seems to span over three very different levels. :-)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads