Android Open Source - android-continuous-voice Language






From Project

Back to project page android-continuous-voice.

License

The source code is released under:

Copyright (c) 2015, Marius Fink - Universit?t Hamburg All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following ...

If you think the Android project android-continuous-voice listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package de.uniHamburg.informatik.continuousvoice.settings;
/*from  w w w . j  a  v  a  2s.co m*/
public enum Language {

    EnUs("en-US", "en", "eng-USA"), DeDe("de-DE", "de", "deu-DEU");

    private final String code2;
    private final String code4;
    private final String code6;

    private Language(String code4, String code2, String code6) {
        this.code2 = code2;
        this.code4 = code4;
        this.code6 = code6;
    }

    public boolean equalsName(String otherName) {
        boolean result = false;
        if (otherName == null) {
            return false;
        }
        
        switch (otherName.length()) {
            case 2:
                result = getCode2().equalsIgnoreCase(otherName);
                break;
            case 5:
                result = getCode4().equalsIgnoreCase(otherName);
                break;
            case 7:
                result = getCode6().equalsIgnoreCase(otherName);
                break;
        }
        return result;
    }

    public String getCode6() {
        return code6;
    }

    public String getCode4() {
        return code4;
    }

    public String getCode2() {
        return code2;
    }

    public static Language getByName(String name) {
        if (name.equalsIgnoreCase("de") || name.equalsIgnoreCase("de-de") || name.equalsIgnoreCase("deu-deu")) {
            return DeDe;
        } else if (name.equalsIgnoreCase("en") || name.equalsIgnoreCase("en-us") || name.equalsIgnoreCase("eng-usa")) {
            return EnUs;
        } else {
            return null;
        }
    }

    public String toString() {
        return getCode4();
    }
}




Java Source Code List

de.uniHamburg.informatik.continuousvoice.MainActivity.java
de.uniHamburg.informatik.continuousvoice.constants.BroadcastIdentifiers.java
de.uniHamburg.informatik.continuousvoice.constants.ServiceControlConstants.java
de.uniHamburg.informatik.continuousvoice.services.recognition.AbstractRecognizer.java
de.uniHamburg.informatik.continuousvoice.services.recognition.IRecognizerControl.java
de.uniHamburg.informatik.continuousvoice.services.recognition.IStatusListener.java
de.uniHamburg.informatik.continuousvoice.services.recognition.ITranscriptionResultListener.java
de.uniHamburg.informatik.continuousvoice.services.recognition.builtIn.AbstractAndroidRecognitionListener.java
de.uniHamburg.informatik.continuousvoice.services.recognition.builtIn.AndroidRecognizer.java
de.uniHamburg.informatik.continuousvoice.services.recognition.dummy.DummyRecognizer.java
de.uniHamburg.informatik.continuousvoice.services.recognition.nuance.NuanceRecognizer.java
de.uniHamburg.informatik.continuousvoice.services.recognition.pocketSphinx.PocketSphinxRecognizer.java
de.uniHamburg.informatik.continuousvoice.services.recognition.webService.ATTWebServiceRecognizer.java
de.uniHamburg.informatik.continuousvoice.services.recognition.webService.AbstractWebServiceRecognizer.java
de.uniHamburg.informatik.continuousvoice.services.recognition.webService.GoogleWebServiceRecognizer.java
de.uniHamburg.informatik.continuousvoice.services.recognition.webService.IspeechWebServiceRecognizer.java
de.uniHamburg.informatik.continuousvoice.services.sound.AudioService.java
de.uniHamburg.informatik.continuousvoice.services.sound.FileMediaRecorder.java
de.uniHamburg.informatik.continuousvoice.services.sound.IAmplitudeListener.java
de.uniHamburg.informatik.continuousvoice.services.sound.IAudioServiceStartStopListener.java
de.uniHamburg.informatik.continuousvoice.services.sound.IRecorder.java
de.uniHamburg.informatik.continuousvoice.settings.GeneralSettings.java
de.uniHamburg.informatik.continuousvoice.settings.Language.java
de.uniHamburg.informatik.continuousvoice.settings.SettingsChangedListener.java
de.uniHamburg.informatik.continuousvoice.views.fragments.RecognizerFragment.java
de.uniHamburg.informatik.continuousvoice.views.fragments.VisualizerFragment.java