LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-08-2004, 11:22 AM   #1
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Rep: Reputation: 56
Script to check Doc-BBB against Doc-AAA for inconsistence


Hi folks,

I'm going to make a script checking inconsistence on 2 documents

Doc-BBB is reproduced from Doc-A, (original document) not with 'copy and paste' command.

Making it simple first, as highlighted in following example, an one line document:-

Doc-AAA
Code:
Check this link to sea what scannars are supported by SANE
Doc-BBB
must be reproduced exactly the same as Doc-AAA, disregarding the typing mistake (spelling mistake)
sea = should read “see”
scannars = should read “scanners”
in order to make sense.

That is to check Doc-BBB to be 100% consistent to Doc-AAA even spelling mistake existing. If a mistake is found on Doc-BBB the mistake will be printed out in pair, such as;

Code:
Doc-AAA   Doc-BBB
sea       sei
character “i” will be highlighted or changed to another colour and its line number and word number also indicated..

Can any folk shed me some light how to start?

TIA

B.R.
satimis
 
Old 11-08-2004, 11:40 AM   #2
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Could I point you to man diff?
 
Old 11-09-2004, 01:43 AM   #3
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Hi XavierP,

Tks for your advice and URL. Test performed as follows;

1)
Original document "doc_a"
Code:
Check this link to sea what scannars are supported by SANE
Already having 2 typing mistakes
sea
scannars

2)
But the reproduced document "doc_b" must maintain these 2 mistakes for consistence.
Code:
check thes link to sea what scannars are suppurted by SeNE
Unfortunately another 3 typing mistakes were further made;
thes
suppurted
SeNE

$ diff doc_a doc_b
It only printed out the content of doc_a and doc_b. I have tried the options on --help

What I expect to have in the printout is;
Code:
Original    Mistake   Line No.   Word No.
this        thes      1          2
supported   suppurted 1          9
SANE        SeNE      1          11
not just printing out their contents and saying "differ"

B.R.
satimis
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
good doc on L.A.M.P abd_bela Debian 1 10-29-2005 08:07 PM
trouble finding policy doc as pdf in doc mirrors stardotstar Debian 2 05-12-2005 10:56 PM
Where can I get some free doc? zhu_liheng Linux - Software 2 09-30-2003 04:56 AM
doc on CGI with c/c++ abd_bela Programming 1 09-07-2003 10:45 AM
Linux and .doc mikeshn Linux - General 1 07-03-2002 12:43 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration