public class PhoneDurationsImpl extends Object implements PhoneDurations
phone mean stddev phone mean stddev phone mean stddev ...Where
phone
is the phone name, mean
is
a float
representing the mean duration of the phone
(typically in seconds), and stddev
is a
float
representing the standard deviation from the
mean.Modifier and Type | Field and Description |
---|---|
private Map<String,PhoneDuration> |
phoneDurations
The set of PhoneDuration instances indexed by phone.
|
Constructor and Description |
---|
PhoneDurationsImpl(URL url)
Creates a new PhoneDurationsImpl by reading from the given URL.
|
Modifier and Type | Method and Description |
---|---|
PhoneDuration |
getPhoneDuration(String phone)
Gets the
PhoneDuration for the given phone. |
private void |
parseAndAdd(String line)
Creates a word from the given input line and adds it to the
map.
|
private Map<String,PhoneDuration> phoneDurations
public PhoneDurationsImpl(URL url) throws IOException
url
- the input sourceIOException
- if an error occursprivate void parseAndAdd(String line)
line
- the input linepublic PhoneDuration getPhoneDuration(String phone)
PhoneDuration
for the given phone. If no
duration is applicable, returns null
.getPhoneDuration
in interface PhoneDurations
phone
- the phonePhoneDuration
for phone
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses