Overview | Package | Class | Tree | Index
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## estraier.pure
Class Document

    java.lang.Object
      estraier.pure.Document

public class Document
extends java.lang.Object

Abstraction of document.

Constructor Summary
`Document()` Create a document object.
`Document(java.lang.String draft)` Create a document object made from draft data.

Method Summary
`void` | `add_attr(java.lang.String name, java.lang.String value)` Add an attribute.
`void` | `add_hidden_text(java.lang.String text)` Add a hidden sentence.
`void` | `add_text(java.lang.String text)` Add a sentence of text.
`java.util.List` | `attr_names()` Get a list of attribute names.
`java.lang.String` | `attr(java.lang.String name)` Get the value of an attribute.
`java.lang.String` | `cat_texts()` Concatenate sentences of the text.
`java.lang.String` | `dump_draft()` Dump draft data.
`int` | `id()` Get the ID number.
`java.util.Map` | `keywords()` Get attached keywords.
`int` | `score()` Get the substitute score.
`void` | `set_keywords(java.util.Map kwords)` Attach keywords.
`java.util.List` | `texts()` Get a list of sentences of the text.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Document

    public Document()

  Create a document object.

### Document

    public Document(java.lang.String draft)

  Create a document object made from draft data.

Parameters:
  `draft` - a string of draft data.

Method Detail

### add_attr

    public void add_attr(java.lang.String name,
                         java.lang.String value)

  Add an attribute.

  Parameters:
    `name` - the name of an attribute.
    `value` - the value of the attribute. If it is `null', the attribute is removed.

### add_hidden_text

    public void add_hidden_text(java.lang.String text)

  Add a hidden sentence.

  Parameters:
    `text` - a hidden sentence.

### add_text

    public void add_text(java.lang.String text)

  Add a sentence of text.

  Parameters:
    `text` - sentence of text.

### attr_names

    public java.util.List attr_names()

  Get a list of attribute names.

  Returns:
    a list object of attribute names.

### attr

    public java.lang.String attr(java.lang.String name)

  Get the value of an attribute.

  Parameters:
    `name` - the name of an attribute.
  Returns:
    the value of the attribute or `null' if it does not exist.

### cat_texts

    public java.lang.String cat_texts()

  Concatenate sentences of the text.

  Returns:
    concatenated sentences.

### dump_draft

    public java.lang.String dump_draft()

  Dump draft data.

  Returns:
    draft data.

### id

    public int id()

  Get the ID number.

  Returns:
    the ID number. If this object has never been registered, -1 is returned.

### keywords

    public java.util.Map keywords()

  Get attached keywords.

  Returns:
    a map object of keywords and their scores in decimal string. If no keyword is attached, `null' is returned.

### score

    public int score()

  Get the substitute score.

  Returns:
    the substitute score or -1 if it is not set.

### set_keywords

    public void set_keywords(java.util.Map kwords)

  Attach keywords.

  Parameters:
    `kwords` - a map object of keywords. Keys of the map should be keywords of the document and values should be their scores in decimal string.

### texts

    public java.util.List texts()

  Get a list of sentences of the text.

  Returns:
    a list object of sentences of the text.

Overview | Package | Class | Tree | Index
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD