亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? kittest.java

?? 本程序用于對頁面信息進行提取并分析
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
// HTMLParser Library $Name: v1_6_20060319 $ - A java-based parser for HTML// Copyright (C) August 26, 2003 Derrick Oswald//// Revision Control Information////    $Source: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/lexerTests/KitTest.java,v $//    $Author: derrickoswald $//    $Date: 2005/05/15 11:49:05 $//    $Revision: 1.10 $//// This library is free software; you can redistribute it and/or// modify it under the terms of the GNU Lesser General Public// License as published by the Free Software Foundation; either// version 2.1 of the License, or (at your option) any later version.//// This library is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU// Lesser General Public License for more details.//// You should have received a copy of the GNU Lesser General Public// License along with this library; if not, write to the Free Software// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA//package org.htmlparser.tests.lexerTests;import java.io.IOException;import java.net.URL;import java.util.Vector;import javax.swing.text.BadLocationException;import javax.swing.text.MutableAttributeSet;import javax.swing.text.html.HTML;import javax.swing.text.html.HTMLEditorKit;import javax.swing.text.html.HTMLEditorKit.Parser;import javax.swing.text.html.HTMLEditorKit.ParserCallback;import org.htmlparser.Attribute;import org.htmlparser.Node;import org.htmlparser.Tag;import org.htmlparser.nodes.AbstractNode;import org.htmlparser.lexer.Cursor;import org.htmlparser.lexer.Lexer;import org.htmlparser.util.ParserException;import org.htmlparser.util.Translate;/** * Compare output from javax.swing.text.html.HTMLEditorKit with Lexer. * This test provides a means of comparing the lexemes from * javax.swing.text.html.HTMLEditorKit.Parser class with the lexemes * produced by the org.htmlparser.lexer.Lexer class. * <blockquote> * The differences have eluded automation since the HTMLEditorKit parser * adds spurious nodes where it thinks elements need closing or it gets * confused.  The intent is to eventually incorporate this into the * 'fit test' and run it against lots of HTML pages, but so far you must * analyse the differences by hand. * </blockquote> */public class KitTest extends ParserCallback{    Vector mNodes;    int mIndex;    /**     * Creates a new instance of KitTest     * @param nodes The list of lexemes from Lexer to compare with the kit lexemes.     */    public KitTest (Vector nodes)    {        mNodes = nodes;        mIndex = 0;    }    /**     * Remove whitespace from a string.     * @param s The string to crunch.     * @return The string with whitespace characters removed.     */    String snowhite (String s)    {        int length;        char ch;        StringBuffer ret;        length = s.length ();        ret = new StringBuffer (length);        for (int i = 0; i < length; i++)        {            ch = s.charAt (i);            if (!Character.isWhitespace (ch) && !(160 == ch))                ret.append (ch);        }        return (ret.toString ());    }    /**     * Check if two strings match.     * @param s1 One string.     * @param s2 The other string.     * @return <code>true</code> if the strings are equivalent ignoring whitespace.     */    boolean match (String s1, String s2)    {        s1 = snowhite (Translate.decode (s1));        s2 = snowhite (Translate.decode (s2));        return (s1.equalsIgnoreCase (s2));    }    /**     * Callback for a text lexeme.     * @param data The text extracted from the page.     * @param pos The position in the page.     * <em>Note: This differs from the Lexer concept of position which is an     * absolute location in the HTML input stream. This position is the character     * position if the text from the page were displayed in a browser.</em>     */    public void handleText (char[] data, int pos)    {        StringBuffer sb;        String theirs;        Node node;        int match;        String ours;        sb = new StringBuffer (data.length);        for (int i = 0; i < data.length; i++)        {            if (160 == data[i])                sb.append ("&nbsp;");            else                sb.append (data[i]);        }        theirs = sb.toString ();        match = -1;        for (int i = mIndex; i < Math.min (mIndex + 25, mNodes.size ()); i++)        {            node = (Node)mNodes.elementAt (i);            ours = node.getText ();            if (match (theirs, ours))            {                match = i;                break;            }        }        if (-1 == match)        {            node = (Node)mNodes.elementAt (mIndex);            ours = node.getText ();            System.out.println ("theirs: " + theirs);            Cursor cursor = new Cursor (((AbstractNode)node).getPage (), node.getStartPosition ());            System.out.println ("ours " + cursor + ": " + ours);        }        else        {            boolean skipped = false;            for (int i = mIndex; i < match; i++)            {                ours = ((Node)mNodes.elementAt (i)).toHtml ();                if (0 != ours.trim ().length ())                {                    if (!skipped)                        System.out.println ("skipping:");                    System.out.println (ours);                    skipped = true;                }            }            if (skipped)            {                System.out.println ("to match:");                node = (Node)mNodes.elementAt (match);                Cursor cursor = new Cursor (((AbstractNode)node).getPage (), node.getStartPosition ());                System.out.println ("@" + cursor + ": " + node.toHtml ());            }//            System.out.println (" match: " + theirs);            mIndex = match + 1;        }    }    /**     * Callback for a remark lexeme.     * @param data The text extracted from the page.     * @param pos The position in the page.     * <em>Note: This differs from the Lexer concept of position which is an     * absolute location in the HTML input stream. This position is the character     * position if the text from the page were displayed in a browser.</em>     */    public void handleComment (char[] data, int pos)    {        StringBuffer sb;        String theirs;        Node node;        int match;        String ours;        sb = new StringBuffer (data.length);        sb.append (data);        theirs = sb.toString ();        match = -1;        for (int i = mIndex; i < Math.min (mIndex + 25, mNodes.size ()); i++)        {            node = (Node)mNodes.elementAt (i);            ours = node.getText ();            if (match (theirs, ours))            {                match = i;                break;            }        }        if (-1 == match)        {            node = (Node)mNodes.elementAt (mIndex);            ours = node.getText ();            System.out.println ("theirs: " + theirs);            Cursor cursor = new Cursor (((AbstractNode)node).getPage (), node.getStartPosition ());            System.out.println ("ours " + cursor + ": " + ours);        }        else        {            boolean skipped = false;            for (int i = mIndex; i < match; i++)            {                ours = ((Node)mNodes.elementAt (i)).toHtml ();                if (0 != ours.trim ().length ())                {                    if (!skipped)                        System.out.println ("skipping:");                    System.out.println (ours);                    skipped = true;                }            }            if (skipped)            {                System.out.println ("to match:");                node = (Node)mNodes.elementAt (match);                Cursor cursor = new Cursor (((AbstractNode)node).getPage (), node.getStartPosition ());                System.out.println ("@" + cursor + ": " + node.toHtml ());            }//            System.out.println (" match: " + theirs);            mIndex = match + 1;        }    }    /**     * Callback for a start tag lexeme.     * @param t The tag extracted from the page.     * @param a The attributes parsed out of the tag.     * @param pos The position in the page.     * <em>Note: This differs from the Lexer concept of position which is an     * absolute location in the HTML input stream. This position is the character     * position if the text from the page were displayed in a browser.</em>     */    public void handleStartTag (HTML.Tag t, MutableAttributeSet a, int pos)    {        String theirs;        Node node;        int match;        String ours;        theirs = t.toString ();        match = -1;        for (int i = mIndex; i < Math.min (mIndex + 25, mNodes.size ()); i++)        {            node = (Node)mNodes.elementAt (i);            if (node instanceof Tag)            {                ours = ((Attribute)(((Tag)node).getAttributesEx ().elementAt (0))).getName ();                if (match (theirs, ours))                {                    match = i;                    break;                }            }        }        if (-1 == match)        {            node = (Node)mNodes.elementAt (mIndex);            ours = node.getText ();            System.out.println ("theirs: " + theirs);            Cursor cursor = new Cursor (((AbstractNode)node).getPage (), node.getStartPosition ());            System.out.println ("ours " + cursor + ": " + ours);        }        else        {            boolean skipped = false;            for (int i = mIndex; i < match; i++)            {                ours = ((Node)mNodes.elementAt (i)).toHtml ();                if (0 != ours.trim ().length ())                {                    if (!skipped)                        System.out.println ("skipping:");                    System.out.println (ours);                    skipped = true;                }            }            if (skipped)            {                System.out.println ("to match:");                node = (Node)mNodes.elementAt (match);                Cursor cursor = new Cursor (((AbstractNode)node).getPage (), node.getStartPosition ());                System.out.println ("@" + cursor + ": " + node.toHtml ());            }//            System.out.println (" match: " + theirs);            mIndex = match + 1;        }    }    /**     * Callback for an end tag lexeme.     * @param t The tag extracted from the page.     * @param pos The position in the page.     * <em>Note: This differs from the Lexer concept of position which is an     * absolute location in the HTML input stream. This position is the character     * position if the text from the page were displayed in a browser.</em>     */    public void handleEndTag (HTML.Tag t, int pos)    {        String theirs;        Node node;        int match;        String ours;        theirs = t.toString ();        match = -1;        for (int i = mIndex; i < Math.min (mIndex + 25, mNodes.size ()); i++)        {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品一区二区久久| 亚洲摸摸操操av| 2023国产一二三区日本精品2022| 欧美电影免费观看高清完整版在| 亚洲人成7777| 国产精品传媒视频| 国产丝袜欧美中文另类| 久久久国际精品| 国产免费观看久久| 国产精品久久国产精麻豆99网站| 国产精品午夜春色av| 欧美激情在线一区二区三区| 亚洲欧洲av色图| 亚洲综合无码一区二区| 亚洲与欧洲av电影| 日本视频一区二区| 国产激情视频一区二区三区欧美| 成人性生交大片免费看在线播放 | 欧美午夜电影一区| 欧美日韩一级视频| 国产一区二区不卡| 国产不卡高清在线观看视频| 成人免费高清视频| 日本韩国精品在线| 欧美年轻男男videosbes| 26uuu亚洲| 自拍偷拍欧美精品| 午夜电影一区二区| 高清不卡在线观看av| 91农村精品一区二区在线| 欧美视频三区在线播放| 久久先锋资源网| 国产精品二三区| 日韩av在线发布| 成人成人成人在线视频| 欧美日韩中文字幕一区| www国产成人| 悠悠色在线精品| 狠狠色综合播放一区二区| 色婷婷精品大在线视频| 精品日韩欧美一区二区| 亚洲欧美日韩国产手机在线| 久久精品国产澳门| 91麻豆免费观看| 精品少妇一区二区三区| 亚洲超丰满肉感bbw| 国产成人午夜视频| 91蜜桃免费观看视频| 久久综合九色综合欧美亚洲| 亚洲影院在线观看| 丁香婷婷深情五月亚洲| 欧美一级精品大片| 夜夜精品视频一区二区| 粉嫩aⅴ一区二区三区四区五区| 欧美亚洲动漫精品| 国产精品免费视频一区| 国内精品自线一区二区三区视频| 欧美婷婷六月丁香综合色| 精品av久久707| 婷婷久久综合九色综合绿巨人| 丁香激情综合国产| 日韩视频在线一区二区| 一区二区三区 在线观看视频| 国产黄色精品网站| 久久亚洲精华国产精华液| 五月婷婷激情综合网| 色视频成人在线观看免| 中文字幕在线观看不卡| 国产成人在线免费| 国产喂奶挤奶一区二区三区| 精品一区二区免费| 欧美一区二区三区不卡| 日韩和欧美一区二区| 欧美午夜精品久久久久久超碰| 欧美日韩国产综合草草| 午夜成人在线视频| 一道本成人在线| 久久亚洲精精品中文字幕早川悠里| 日韩成人免费看| 欧美影片第一页| 午夜日韩在线电影| 欧美日韩一二区| 亚洲第一激情av| 欧美一区二区三区四区五区| 日本在线播放一区二区三区| 在线电影欧美成精品| 亚洲18影院在线观看| 欧美日韩国产综合草草| 秋霞影院一区二区| 精品日韩99亚洲| 国产精品中文字幕一区二区三区| 久久九九久久九九| 国产成人a级片| 国产精品你懂的在线| 在线精品亚洲一区二区不卡| 天天做天天摸天天爽国产一区| 欧美日韩国产系列| 精品写真视频在线观看| 日韩视频中午一区| 成人午夜免费av| 一区二区三区四区在线播放| 在线播放日韩导航| 国产成人av电影在线观看| 国产精品久久久久久福利一牛影视 | 国产精品99久久久久久宅男| 狠狠久久亚洲欧美| 99精品国产热久久91蜜凸| 中文字幕中文字幕一区| 91成人免费网站| 久久国产精品99久久人人澡| 国产调教视频一区| 欧亚洲嫩模精品一区三区| 久久99热狠狠色一区二区| 中文字幕不卡在线观看| 欧美日韩1区2区| 成人黄色国产精品网站大全在线免费观看| 最新国产成人在线观看| 精品国产乱码久久久久久久久| 波多野结衣一区二区三区| 午夜天堂影视香蕉久久| 国产精品人成在线观看免费| www.日韩av| 久久成人免费网| 天涯成人国产亚洲精品一区av| 欧美国产精品中文字幕| 91在线一区二区三区| 国产精品视频一二三区 | 亚洲第一狼人社区| 欧美精品久久天天躁| 粉嫩久久99精品久久久久久夜 | 久久九九久久九九| 欧美日韩在线精品一区二区三区激情| 激情综合亚洲精品| 香蕉乱码成人久久天堂爱免费| 久久精品综合网| 日韩免费视频一区| 欧美性生活大片视频| 成人午夜又粗又硬又大| 日韩成人精品在线观看| 中文字幕日本不卡| 国产精品丝袜久久久久久app| 精品国免费一区二区三区| 欧美色手机在线观看| www.亚洲精品| 中文字幕中文字幕一区| 久久精品亚洲精品国产欧美| 欧美精品在线视频| 91成人看片片| 91黄色激情网站| 91视频在线观看免费| 国产成人免费视频网站高清观看视频 | 久久成人麻豆午夜电影| 日日骚欧美日韩| 五月天欧美精品| 三级在线观看一区二区| 午夜av一区二区| 日韩精品1区2区3区| 日韩精品一二三区| 日本中文一区二区三区| 日本强好片久久久久久aaa| 亚洲成人免费视| 午夜精品久久久久久久久久| 天天综合网天天综合色| 午夜精品久久一牛影视| 麻豆成人在线观看| 久久99国产精品成人| 国产最新精品精品你懂的| 国产白丝精品91爽爽久久| 顶级嫩模精品视频在线看| 91丨九色丨尤物| 欧美色精品在线视频| 欧美男生操女生| 久久九九久久九九| 亚洲欧美日韩电影| 日韩精品免费专区| 精品一区二区三区在线视频| 国产大片一区二区| 欧洲色大大久久| 欧美成人一区二区三区在线观看| 久久精品视频免费观看| 亚洲欧美日韩精品久久久久| 视频一区欧美日韩| 韩国三级中文字幕hd久久精品| 成人午夜av影视| 欧美日韩国产在线播放网站| www久久精品| 一区二区三区资源| 精彩视频一区二区三区| 99久久免费视频.com| 欧美精品一卡两卡| 国产丝袜欧美中文另类| 国产精品久久久久一区| 日本麻豆一区二区三区视频| 粉嫩在线一区二区三区视频| 欧美日本一区二区| 久久久久久久网| 亚洲成人av免费| 99国产欧美另类久久久精品| 日韩一区二区视频在线观看| 专区另类欧美日韩|