Class PhonoSystem
- java.lang.Object
-
- net.oijon.oling.datatypes.phonology.PhonoSystem
-
public class PhonoSystem extends java.lang.Object
A way to transcribe all sounds allowed in a vocal tract. IPA is specified here as that is a standard for human sounds, however PhonoSystems can be created for non-human sounds as well.- Author:
- alex
-
-
Field Summary
Fields Modifier and Type Field Description static PhonoSystem
IPA
Creates an IPA preset.
-
Constructor Summary
Constructors Constructor Description PhonoSystem(java.io.File file)
Loads a PhonoSystem object from a filePhonoSystem(java.lang.String name)
Creates a PhonoSystem object with a blank category list.PhonoSystem(java.lang.String name, java.util.ArrayList<PhonoTable> tables)
Creates a PhonoSystem object with a pre-defined ArrayListPhonoSystem(java.lang.String name, java.util.ArrayList<PhonoTable> tables, java.util.ArrayList<java.lang.String> diacriticList)
PhonoSystem(PhonoSystem ps)
Copy constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(java.lang.String value)
Checks if a given value exists in a phono system.boolean
equals(java.lang.Object obj)
java.util.ArrayList<java.lang.String>
getDiacritics()
java.lang.String
getName()
Gets the name of the phono systemjava.lang.String
getSound(int i, int x, int y)
Allows use of an XY coordinate system to get soundsjava.util.ArrayList<PhonoTable>
getTables()
Gets an ArrayList of all of the categories addedstatic PhonoSystem
parse(Multitag docTag)
void
removeTable(java.lang.String name)
Removes table based off name.void
setDiacritics(java.util.ArrayList<java.lang.String> newList)
void
toFile()
Creates a file of the PhonoSystem.java.lang.String
toString()
Converts a PhonoSystem object to a string
-
-
-
Field Detail
-
IPA
public static final PhonoSystem IPA
Creates an IPA preset. Useful when we just want the default PhonoSystem.
-
-
Constructor Detail
-
PhonoSystem
public PhonoSystem(java.lang.String name, java.util.ArrayList<PhonoTable> tables)
Creates a PhonoSystem object with a pre-defined ArrayList- Parameters:
name
- The name of the phono systemtables
- The list of all tables used in the phono system
-
PhonoSystem
public PhonoSystem(java.lang.String name, java.util.ArrayList<PhonoTable> tables, java.util.ArrayList<java.lang.String> diacriticList)
-
PhonoSystem
public PhonoSystem(java.lang.String name)
Creates a PhonoSystem object with a blank category list. This list will need something added to it to work!- Parameters:
name
- The name of the phono system
-
PhonoSystem
public PhonoSystem(PhonoSystem ps)
Copy constructor- Parameters:
ps
- The PhonoSystem to be copied
-
PhonoSystem
public PhonoSystem(java.io.File file)
Loads a PhonoSystem object from a file
-
-
Method Detail
-
getName
public java.lang.String getName()
Gets the name of the phono system- Returns:
- The name of the phono system
-
getTables
public java.util.ArrayList<PhonoTable> getTables()
Gets an ArrayList of all of the categories added- Returns:
- ArrayList of several PhonoCategory instances
-
removeTable
public void removeTable(java.lang.String name)
Removes table based off name. As this is slower than removing via index, removing via index is preferred.- Parameters:
name
- Name of category to be removed
-
getSound
public java.lang.String getSound(int i, int x, int y)
Allows use of an XY coordinate system to get sounds- Parameters:
i
- Index of tablex
- Index of categoryy
- Index of sound- Returns:
- The sound at both indexes
-
setDiacritics
public void setDiacritics(java.util.ArrayList<java.lang.String> newList)
-
getDiacritics
public java.util.ArrayList<java.lang.String> getDiacritics()
-
parse
public static PhonoSystem parse(Multitag docTag) throws java.lang.Exception
- Throws:
java.lang.Exception
-
toString
public java.lang.String toString()
Converts a PhonoSystem object to a string- Overrides:
toString
in classjava.lang.Object
-
contains
public boolean contains(java.lang.String value)
Checks if a given value exists in a phono system.- Parameters:
value
- The value to be checked- Returns:
- Returns true if value is found in phono system, false if not
-
toFile
public void toFile()
Creates a file of the PhonoSystem.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-