亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
欧美日韩第一区日日骚| 亚洲成a人v欧美综合天堂| 国产精品系列在线观看| 国产精品污污网站在线观看| 欧美精品乱码久久久久久| 蜜桃久久av一区| 自拍偷拍欧美精品| 日韩一区二区三区av| 国产99久久久久| 欧美三级蜜桃2在线观看| 男男gaygay亚洲| 国产精品国产馆在线真实露脸| 日韩精品福利网| 国产精品天天摸av网| 欧美电影在哪看比较好| 国产精品77777| 亚洲在线视频网站| 国产欧美精品一区| 日韩欧美一区在线| 在线观看日韩高清av| 国产精品一区二区三区网站| 奇米亚洲午夜久久精品| 亚洲视频一区在线| 久久午夜电影网| 另类中文字幕网| 亚洲欧美视频一区| 国产欧美一区二区精品性色超碰 | 欧美三级日韩三级国产三级| 国产91在线|亚洲| 奇米一区二区三区| 亚洲欧美日韩综合aⅴ视频| 精品国产不卡一区二区三区| 欧美三级电影在线看| 99精品欧美一区| 国产白丝精品91爽爽久久| 日韩精品福利网| 爽好多水快深点欧美视频| 亚洲乱码中文字幕综合| 国产欧美一区二区三区鸳鸯浴| 久久一夜天堂av一区二区三区| 欧美伦理视频网站| 欧美午夜精品一区| 欧美三级中文字幕在线观看| 91麻豆免费看| 波多野结衣91| 91网站黄www| 成人18精品视频| 日本一区二区三区视频视频| 欧美亚洲动漫制服丝袜| 欧美系列在线观看| 日本黄色一区二区| 色综合一区二区三区| 99精品视频在线观看| www.性欧美| 91一区二区三区在线观看| 99国产精品久| 在线视频一区二区免费| 91在线视频18| 91麻豆成人久久精品二区三区| 91久久精品日日躁夜夜躁欧美| 91一区二区在线| 色88888久久久久久影院野外 | 在线观看免费视频综合| 99久久精品国产网站| 色综合久久综合| 欧美三级日本三级少妇99| 97aⅴ精品视频一二三区| 在线观看91精品国产入口| 欧洲av在线精品| 欧美午夜理伦三级在线观看| 在线成人免费观看| 日韩视频免费观看高清完整版在线观看 | 亚洲国产日韩综合久久精品| 五月天欧美精品| 国产一区二区调教| 精品一区二区三区免费毛片爱| 粉嫩一区二区三区性色av| 成人av免费在线观看| 99热国产精品| 91精品国产综合久久香蕉麻豆| 日韩视频国产视频| 色8久久精品久久久久久蜜| 欧美一区二区三区视频免费播放| 夫妻av一区二区| 91原创在线视频| 欧美一区二区三区公司| 国产亚洲精品bt天堂精选| 国产日韩欧美不卡| 亚洲成人精品在线观看| 精品亚洲aⅴ乱码一区二区三区| 粉嫩av亚洲一区二区图片| 色综合天天狠狠| 日韩欧美一区二区三区在线| 中文字幕一区二区三区色视频 | 色噜噜狠狠色综合中国| 欧美成人精品福利| 欧美老肥妇做.爰bbww视频| 日韩精品自拍偷拍| 亚洲特黄一级片| 亚洲一区二区在线播放相泽| 久久成人免费电影| 一本色道久久综合精品竹菊| 日韩欧美国产一区二区在线播放 | 91网址在线看| 欧美一区二区三区在线观看 | 91精品国产aⅴ一区二区| 欧美日韩情趣电影| 国产精品三级av| 秋霞国产午夜精品免费视频| 国模一区二区三区白浆| 在线看国产一区| 精品国产乱码久久久久久久久| 亚洲影视在线播放| 国产乱码精品一区二区三区av | 国产成人自拍网| 欧美色网一区二区| 国产午夜精品久久久久久久| 美国欧美日韩国产在线播放| 色综合天天综合网天天狠天天| 精品国产一区a| 另类欧美日韩国产在线| 在线一区二区三区四区| 国产亚洲精品bt天堂精选| 精品影视av免费| 欧美日韩免费一区二区三区视频 | 麻豆精品在线视频| 日本高清视频一区二区| 国产日韩欧美制服另类| 久久精品国产一区二区| 欧美日韩精品免费| 亚洲一卡二卡三卡四卡无卡久久 | 中文字幕综合网| 国产综合一区二区| 欧美一级在线观看| 国产精品一级片| 久久综合九色综合欧美98| 亚洲成人免费电影| 在线一区二区观看| 亚洲精品国产精华液| 91一区在线观看| 国产精品美日韩| 成人精品视频一区| 欧美一区二区三区日韩| 日韩av一二三| 99在线精品观看| 一区二区激情视频| 91视频观看免费| 亚洲精品乱码久久久久久久久| 9i在线看片成人免费| 国产精品国产自产拍高清av| 91原创在线视频| 亚洲三级免费观看| 97久久精品人人做人人爽50路| 中文字幕一区二区三区色视频| 99久久夜色精品国产网站| 中文在线资源观看网站视频免费不卡| 免费不卡在线视频| 欧美xfplay| 国产资源在线一区| 欧美一区二区视频在线观看| 美国十次了思思久久精品导航| 欧美r级电影在线观看| 美国一区二区三区在线播放| 日本一区二区视频在线| 成人av免费在线观看| 亚洲免费资源在线播放| 欧美精品少妇一区二区三区| 日韩激情在线观看| 日韩午夜激情视频| 成人小视频在线| 国产精品久久久久久久久晋中 | 国产日产欧美一区| 欧美精品一卡二卡| 欧美巨大另类极品videosbest | av色综合久久天堂av综合| 一区二区激情视频| 一区二区不卡在线播放 | 中文字幕欧美激情| 国产精品一二三在| xnxx国产精品| 91丨porny丨最新| 亚洲美女一区二区三区| 日韩免费看网站| 99久久精品情趣| 极品少妇xxxx精品少妇| 亚洲精品你懂的| 久久免费美女视频| 欧美三级午夜理伦三级中视频| 国内外成人在线| 亚洲成a人片综合在线| 国产女人18水真多18精品一级做 | 日韩一区二区高清| 成人国产免费视频| 日本少妇一区二区| 国产精品五月天| 精品日韩一区二区三区免费视频| 色呦呦国产精品| 国产福利电影一区二区三区| 日本欧美韩国一区三区| 亚洲精品国产a久久久久久 |