|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.umd.cloud9.collection.Indexable
edu.umd.cloud9.collection.wikipedia.WikipediaPage
public abstract class WikipediaPage
A page from Wikipedia.
| Nested Class Summary | |
|---|---|
static class |
WikipediaPage.Link
|
| Field Summary | |
|---|---|
static String |
XML_END_TAG
End delimiter of the page, which is < /page>. |
static String |
XML_START_TAG
Start delimiter of the page, which is < page>. |
| Constructor Summary | |
|---|---|
WikipediaPage()
Creates an empty WikipediaPage object. |
|
| Method Summary | |
|---|---|
List<WikipediaPage.Link> |
extractLinks()
|
List<String> |
extractLinkTargets()
|
String |
findInterlanguageLink(String lang)
Returns the inter-language link to a specific language (if any). |
String |
getContent()
Returns the contents of this page (title + text). |
String |
getDisplayContent()
Returns the content of the document for display to a human. |
String |
getDisplayContentType()
Returns the type of the display content, per IANA MIME Media Type (e.g., "text/html"). |
String |
getDocid()
Returns the article title (i.e., the docid). |
String |
getLanguage()
|
String |
getRawXML()
Returns the raw XML of this page. |
String |
getTitle()
Returns the title of this page. |
String |
getWikiMarkup()
Returns the text of this page. |
boolean |
isArticle()
Checks to see if this page lives in the main/article namespace, and not, for example, "File:", "Category:", "Wikipedia:", etc. |
boolean |
isDisambiguation()
Checks to see if this page is a disambiguation page. |
boolean |
isEmpty()
Checks to see if this page is an empty page. |
boolean |
isRedirect()
Checks to see if this page is a redirect page. |
boolean |
isStub()
Checks to see if this article is a stub. |
void |
readFields(DataInput in)
Serializes this object. |
static void |
readPage(WikipediaPage page,
String s)
Reads a raw XML string into a WikipediaPage object. |
void |
setLanguage(String language)
Deprecated. |
void |
write(DataOutput out)
Deserializes this object. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String XML_START_TAG
page>.
public static final String XML_END_TAG
/page>.
| Constructor Detail |
|---|
public WikipediaPage()
WikipediaPage object.
| Method Detail |
|---|
public void write(DataOutput out)
throws IOException
IOException
public void readFields(DataInput in)
throws IOException
IOExceptionpublic String getDocid()
getDocid in class Indexable@Deprecated public void setLanguage(String language)
public String getLanguage()
public String getContent()
getContent in class Indexablepublic String getDisplayContent()
Indexable
getDisplayContent in class Indexablepublic String getDisplayContentType()
Indexablehttp://www.iana.org/assignments/media-types/index.html
getDisplayContentType in class Indexablepublic String getRawXML()
public String getWikiMarkup()
public String getTitle()
public boolean isDisambiguation()
WikipediaPage is either an
article, a disambiguation page, a redirect page, or an empty page.
true if this page is a disambiguation pagepublic boolean isRedirect()
WikipediaPage is either an
article, a disambiguation page, a redirect page, or an empty page.
true if this page is a redirect pagepublic boolean isEmpty()
WikipediaPage is either an article,
a disambiguation page, a redirect page, or an empty page.
true if this page is an empty pagepublic boolean isStub()
true if this article is a stubpublic boolean isArticle()
true if this page is an actual articlepublic String findInterlanguageLink(String lang)
lang - language
null
otherwisepublic List<WikipediaPage.Link> extractLinks()
public List<String> extractLinkTargets()
public static void readPage(WikipediaPage page,
String s)
WikipediaPage object.
page - the WikipediaPage objects - raw XML string
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||