[Bug 508973] [NEW] improper matching of certain words

outleradam outleradam at hotmail.com
Mon Jan 18 01:28:23 UTC 2010


Public bug reported:

Binary package hint: agrep

Hello, I am designing a program which takes a episode name and a series
name and then renames a file with series and episode information from
thetvdb.com and renames mythtv recordings while allowing mythtv to serve
and delete the content.  See my script here:  http://xbmc.org/wiki/?title=MythicalLibrarian

I found a serious yet localized problem with the -B option.  I've got a
list of names...

If Theres Anything I Cant Stand
If...

agrep -byn "If..."

returns If Theres Anything I Cant Stand


to recreate you can do what my script does:
First apt-get install agrep

####COPY AND PASTE THE FOLLOWING####

#this simulates downloading the information from theTvDb.com
echo "<EpisodeName>If Theres Anything I Cant Stand</EpisodeName>
<EpisodeName>If...</EpisodeName>">>~/myfile

#Simulates parsing of the xml file into a 
cat ~/myfile | grep "<EpisodeName>"|replace "  <EpisodeName>" ""|replace
"</EpisodeName>" ""|tr -d '/*&$#!\{}>?<,' > ~myfile.Ename.txt

#agrep -Byn should display best match with line number, the best match is "If..."
absolouteEpisodeNumber=`agrep -Byn "If..." "~myfile.Ename.txt"|grep -m1 ^`

#Should be line 2: If...  but agrep displays line 1: If Theres Anything I Cant Stand
echo absolouteEpisodeNumber
####END SCRIPT####

This problem shows that for some reason the "best match" option does not
work in this case where the best match contains either periods, or is 2
letters long with 3 special charactors.  I don't know what is causing
this error.

** Affects: agrep (Ubuntu)
     Importance: Undecided
         Status: New

-- 
improper matching of certain words
https://bugs.launchpad.net/bugs/508973
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs at lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs




More information about the universe-bugs mailing list