public final static boolean isUrlAddress(String str, ADictionary dic)
    {
        int prIndex = str.indexOf("://");
        if ( prIndex > -1 && ! StringUtil.isLatin(str, 0, prIndex) ) {
            return false;
        }
        
        int sIdx = prIndex > -1 ? prIndex + 3 : 0;
        int slIndex = str.indexOf('/', sIdx), sgIndex = str.indexOf('?', sIdx);
        int eIdx = slIndex > -1 ? slIndex : (sgIndex > -1 ? sgIndex : str.length());
        int lpIndex = -1;
        for ( int i = sIdx; i < eIdx; i++ ) {
            char chr = str.charAt(i);
            if ( chr == '.' ) {
                if ( lpIndex == -1 ) {
                    lpIndex = i;
                    continue;
                }
                
                if ( (i - lpIndex) == 1 || i == (eIdx - 1)) {
                    return false;
                }
                
                lpIndex = i;
            } else if ( ! StringUtil.isEnLetter(chr) 
                    && ! StringUtil.isEnNumeric(chr) ) {
                return false;
            }
        }
        
        if ( dic != null && ! dic.match(ILexicon.DOMAIN_SUFFIX, 
                str.substring(lpIndex+1, eIdx)) ) {
            return false;
        }
        
        //check the path part
        if ( slIndex > -1 ) {
            sIdx = slIndex;
            eIdx = sgIndex > -1 ? sgIndex : str.length();
            lpIndex = -1;
            for ( int i = sIdx; i < eIdx; i++ ) {
                char chr = str.charAt(i);
                if ( "./-_".indexOf(chr) > -1 ) {
                    if ( lpIndex == -1 ) {
                        lpIndex = i;
                        continue;
                    }
                    
                    if ( i - lpIndex == 1 || (chr == '.' && i == (eIdx - 1)) ) {
                        return false;
                    }
                    
                    lpIndex = i;
                } else if ( ! StringUtil.isEnLetter(chr) 
                        &&  ! StringUtil.isEnNumeric(chr) ) {
                    return false;
                }
            }
        }
        
        return true;
    }
public final static boolean isUrlAddress ( String str , ADictionary dic ) { int prIndex = str . indexOf ( "://" ) ; if ( prIndex > - 1 && ! StringUtil . isLatin ( str , 0 , prIndex ) ) { return false ; } int sIdx = prIndex > - 1 ? prIndex + 3 : 0 ; int slIndex = str . indexOf ( '/' , sIdx ) , sgIndex = str . indexOf ( '?' , sIdx ) ; int eIdx = slIndex > - 1 ? slIndex : ( sgIndex > - 1 ? sgIndex : str . length ( ) ) ; int lpIndex = - 1 ; for ( int i = sIdx ; i < eIdx ; i ++ ) { char chr = str . charAt ( i ) ; if ( chr == '.' ) { if ( lpIndex == - 1 ) { lpIndex = i ; continue ; } if ( ( i - lpIndex ) == 1 || i == ( eIdx - 1 ) ) { return false ; } lpIndex = i ; } else if ( ! StringUtil . isEnLetter ( chr ) && ! StringUtil . isEnNumeric ( chr ) ) { return false ; } } if ( dic != null && ! dic . match ( ILexicon . DOMAIN_SUFFIX , str . substring ( lpIndex + 1 , eIdx ) ) ) { return false ; } if ( slIndex > - 1 ) { sIdx = slIndex ; eIdx = sgIndex > - 1 ? sgIndex : str . length ( ) ; lpIndex = - 1 ; for ( int i = sIdx ; i < eIdx ; i ++ ) { char chr = str . charAt ( i ) ; if ( "./-_" . indexOf ( chr ) > - 1 ) { if ( lpIndex == - 1 ) { lpIndex = i ; continue ; } if ( i - lpIndex == 1 || ( chr == '.' && i == ( eIdx - 1 ) ) ) { return false ; } lpIndex = i ; } else if ( ! StringUtil . isEnLetter ( chr ) && ! StringUtil . isEnNumeric ( chr ) ) { return false ; } } } return true ; }
check if the specified string is an URL address or not

@param   str
@param   dic optional dictionary object
@return  boolean