Displaying 1 result from an estimated 1 matches for "matchphrase".
2010 Jul 12
1
Comparison of two very large strings
...using to compare the two strings:-
stringCompare <- function(currentURL, currentId){
j <- currentId - 1
while(j>=1)
previousURL <- urlDataFrame[j,"url"]
previousURLLength <- nchar(previousURL)
#Compare smaller with bigger
if(nchar(currentURL) <= previousURLLength){
matchPhrase <- substr(previousURL,1,nchar(currentURL))
if(matchPhrase == currentURL){
return(TRUE)
}
}else{
matchPhrase <- substr(currentURL,1,previousURLLength)
if(matchPhrase == previousURL){
return(TRUE)
}
}
j <- j -1
}
return(FALSE)
}
Here, I compare the URL at a given row with all the previ...