## edu.stanford.nlp.ling
Class StringLabelFactory

    java.lang.Object
      edu.stanford.nlp.ling.StringLabelFactory

All Implemented Interfaces:
  LabelFactory

    public class StringLabelFactory

extends Object
implements LabelFactory

A `StringLabelFactory` object makes a simple `StringLabel` out of a `String`.

Author:
  Christopher Manning

Constructor Summary
`StringLabelFactory()`

Method Summary
`Label` `newLabel(Label oldLabel)` Create a new `StringLabel`, where the label is formed from the `Label` object passed in.
`Label` `newLabel(String labelStr)` Make a new label with this `String` as the "name".
`Label` `newLabel(String labelStr, int options)` Make a new label with this `String` as the "name".
`Label` `newLabelFromString(String labelStr)` Make a new label with this `String` as the "name".

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

Constructor Detail

### StringLabelFactory

    public StringLabelFactory()

Method Detail

### newLabel

    public Label newLabel(String labelStr)

  Make a new label with this `String` as the "name".

  Specified by:
    `newLabel` in interface `LabelFactory`
  Parameters:
    `labelStr` - A string that determines the content of the label. For a StringLabel, it is exactly the given string
  Returns:
    The created label

### newLabel

    public Label newLabel(String labelStr,
                          int options)

  Make a new label with this `String` as the "name".

  Specified by:
    `newLabel` in interface `LabelFactory`
  Parameters:
    `labelStr` - A string that determines the content of the label. For a StringLabel, it is exactly the given string
    `options` - The options are ignored by a StringLabelFactory
  Returns:
    The created label

### newLabelFromString

    public Label newLabelFromString(String labelStr)

  Make a new label with this `String` as the "name". This version does no decoding -- StringLabels just have a value.

  Specified by:
    `newLabelFromString` in interface `LabelFactory`
  Parameters:
    `labelStr` - A string that determines the content of the label. For a StringLabel, it is exactly the given string
  Returns:
    The created label

### newLabel

    public Label newLabel(Label oldLabel)

  Create a new `StringLabel`, where the label is formed from the `Label` object passed in. Depending on what fields each label has, other things will be `null`.

  Specified by:
    `newLabel` in interface `LabelFactory`
  Parameters:
    `oldLabel` - The Label that the new label is being created from
  Returns:
    a new label of a particular type

Stanford NLP Group