Class Column

  • All Implemented Interfaces:
    nzilbb.util.CloneableBean

    public class Column
    extends Object
    implements nzilbb.util.CloneableBean
    One column in a search matrix, containing patterns matching one word token.
    • Constructor Detail

      • Column

        public Column()
    • Method Detail

      • getLayers

        @ClonedProperty
        public Map<String,​List<LayerMatch>> getLayers()
        Getter for layers: The layer patterns that match a word token. Keys are layer IDs.

        Generally there will be one LayerMatch per layer in a column, but for word-internal segment context matching, there may be more than one, corresponding to multiple sequential segments within the word.

        Returns:
        The layer patterns that match a word token.
      • setLayers

        public Column setLayers​(Map<String,​List<LayerMatch>> newLayers)
        Setter for layers: The layer patterns that match a word token. Keys are layer IDs.

        Generally there will be one LayerMatch per layer in a column, but for word-internal segment context matching, there may be more than one, corresponding to multiple sequential segments within the word.

        Parameters:
        newLayers - The layer patterns that match a word token.
      • getAdj

        @ClonedProperty
        public int getAdj()
        Getter for adj: Adjecency; how far matches of the following column in the matrix can be from matches of this column. 1 means it must immediately follow, 2 means there can be one intervening token, etc.
        Returns:
        Adjecency; how far matches of the following column in the matrix can be from matches of this column.
      • setAdj

        public Column setAdj​(int newAdj)
        Setter for adj: Adjecency; how far matches of the following column in the matrix can be from matches of this column. 1 means it must immediately follow, 2 means there can be one intervening token, etc.
        Parameters:
        newAdj - Adjecency; how far matches of the following column in the matrix can be from matches of this column.
      • addLayerMatch

        public Column addLayerMatch​(LayerMatch layerPattern)
        Convenience builder-pattern method for adding a layer pattern.
        Parameters:
        layerPattern -
        Returns:
        This column.
      • getFirstLayerMatch

        public LayerMatch getFirstLayerMatch​(String layerId)
        Gets the first match for the given layer, if any.
        Parameters:
        layerId -
        Returns:
        The first match for the given layer, or null if there is none.
      • fromJson

        public nzilbb.util.CloneableBean fromJson​(javax.json.JsonObject json)
        Initializes the bean with the given JSON representation.
        Specified by:
        fromJson in interface nzilbb.util.CloneableBean
        Parameters:
        json -
        Returns:
        A reference to this object.
      • toString

        public String toString()
        Returns the JSON serialization of this column.
        Overrides:
        toString in class Object
        Returns:
        The JSON serialization of this column.