Package nzilbb.encoding
Class ValidLabelsDefinitions
- java.lang.Object
-
- nzilbb.encoding.ValidLabelsDefinitions
-
public class ValidLabelsDefinitions extends Object
Utility functions for generating predefined valid-label definitions using different encodings.LaBB-CAT extends the
Layer.validLabels
funcionality by supporting an alternative layer attribute: validLabelsDefinition, which is an array of label definitions, each definition being a map of string to string or integer. Each label definition is expected to have the following attributes:- label
- what the underlying label is in LaBB-CAT (i.e. the DISC label, for a DISC layer)
- display
- the symbol in the transcript, for the label (e.g. the IPA version of the label)
- selector
- the symbol on the label helper, for the label (e.g. the IPA version of the label) - if there's no selector specified, then the value for display is used, and if there's no value for display specified, then there's no option on the label helper (so that type-able consonants like p, b, t, d etc. don't take up space on the label helper)
- description
- tool-tip text that appears if you hover the mouse over the IPA symbol in the helper
- category
- the broad category of the symbol, for organizing the layout of the helper
- subcategory
- the narrower category of the symbol, for listing subgroups of symbols together
- display_order
- the order to process/list the labels in
- Author:
- Robert Fromont robert@fromont.net.nz
-
-
Constructor Summary
Constructors Constructor Description ValidLabelsDefinitions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<Map<String,Object>>
AddARPAbetDefinitions(List<Map<String,Object>> validLabelsDefinition)
Add standard ARPAbet-phoneme label definitions to the given map.static List<Map<String,Object>>
AddDISCDefinitions(List<Map<String,Object>> validLabelsDefinition)
Add standard DISC-phoneme label definitions to the given map.static List<Map<String,Object>>
AddIPADefinitions(List<Map<String,Object>> validLabelsDefinition, List<String> labels)
Add given labels, which are assumed to be IPA, to the given map.static List<Map<String,Object>>
AddMausSAMPADefinitions(List<Map<String,Object>> validLabelsDefinition)
Add standard MAUS SAMPA-phoneme label definitions to the given map.static List<Map<String,Object>>
AddSAMPADefinitions(List<Map<String,Object>> validLabelsDefinition)
Add standard SAMPA-phoneme label definitions to the given map.static List<Map<String,Object>>
AddXSAMPADefinitions(List<Map<String,Object>> validLabelsDefinition)
Add standard X-SAMPA-phoneme label definitions to the given map.static LinkedHashMap<String,String>
ValidLabelsFromDefinition(List<Map<String,Object>> validLabelsDefinition)
Generates a map of labels to description suitable for Layer#validLabels, given a fuller defition of labels.
-
-
-
Method Detail
-
AddARPAbetDefinitions
public static List<Map<String,Object>> AddARPAbetDefinitions(List<Map<String,Object>> validLabelsDefinition)
Add standard ARPAbet-phoneme label definitions to the given map.- Parameters:
validLabelsDefinition
- Map containing existing definitions, if any.- Returns:
- validLabelsDefinition
-
AddDISCDefinitions
public static List<Map<String,Object>> AddDISCDefinitions(List<Map<String,Object>> validLabelsDefinition)
Add standard DISC-phoneme label definitions to the given map.- Parameters:
validLabelsDefinition
- Map containing existing definitions, if any.- Returns:
- validLabelsDefinition
-
AddMausSAMPADefinitions
public static List<Map<String,Object>> AddMausSAMPADefinitions(List<Map<String,Object>> validLabelsDefinition)
Add standard MAUS SAMPA-phoneme label definitions to the given map.- Parameters:
validLabelsDefinition
- Map containing existing definitions, if any.- Returns:
- validLabelsDefinition
-
AddSAMPADefinitions
public static List<Map<String,Object>> AddSAMPADefinitions(List<Map<String,Object>> validLabelsDefinition)
Add standard SAMPA-phoneme label definitions to the given map.- Parameters:
validLabelsDefinition
- Map containing existing definitions, if any.- Returns:
- validLabelsDefinition
-
AddXSAMPADefinitions
public static List<Map<String,Object>> AddXSAMPADefinitions(List<Map<String,Object>> validLabelsDefinition)
Add standard X-SAMPA-phoneme label definitions to the given map.- Parameters:
validLabelsDefinition
- Map containing existing definitions, if any.- Returns:
- validLabelsDefinition
-
AddIPADefinitions
public static List<Map<String,Object>> AddIPADefinitions(List<Map<String,Object>> validLabelsDefinition, List<String> labels)
Add given labels, which are assumed to be IPA, to the given map.- Parameters:
validLabelsDefinition
- Map containing existing definitions, if any.labels
- Labels to add.- Returns:
- validLabelsDefinition
-
ValidLabelsFromDefinition
public static LinkedHashMap<String,String> ValidLabelsFromDefinition(List<Map<String,Object>> validLabelsDefinition)
Generates a map of labels to description suitable for Layer#validLabels, given a fuller defition of labels.- Parameters:
validLabelsDefinition
-- Returns:
- A map of labels to descriptions.
-
-