References [1] “Bbc.co.uk, ‘BBC - Languages - Languages - Languages of the world - Interesting facts about languages.’” [Online], Available: http://www.bbc.co.uk/languages/guide/languages.shtml. [Accessed: 14-Nov-2015], [2] A. Wasala and K. Gamage, “Research Report on Phonetics and Phonology of Sinhala,” University of Colombo School of Computing, Colombo. [3] “CMU Sphinx.”. [4] T. Nadungodage and R. Weerasinghe, “Continuous Sinhala speech recognizer,” in Conference on Human Language Technology for Development, Alexandria, Egypt, 2011, pp. 2-5. [5] S. Furui, “AUTOMATIC SPEECH RECOGNITION AND ITS APPLICATION TO INFORMATION EXTRACTION.” Tokyo institute of Technology. [6] “Neural Networks.” [Online]. Available: https://www.doc.ic.ac.uk/~nd/surprise_96/joumal/voI4/cs 11/report.html. [Accessed: 28-Jan-2016]. [7] T. Nadungodage, V. Welgama, and R. Weerasinghe, “Developing a Speech Corpus for Sinhala Speech Recognition.”. [8] C. Richey, “Speech Corpora.” Apr-2000. [9] S. Chen, D. Beeferman, and R. Rosenfeld, “EVALUATION METRICS FOR LANGUAGE MODELS,” Carnegie Mellon University, Pittsburgh, PA 15213. [10] N. a. C. Sandasarani, “Sinhala Speech Recognition,” Int. J. Eng. Res. Technol., vol. Vol. 4, no. Issue 10, pp. 391-394, Oct. 2015. [11] S. Molau, M. Pitz, R. Schf’uter, and H. Ney, “COMPUTING MEL-FREQUENCY CEPSTRAL COEFFICIENTS ON THE POWER SPECTRUM,” RWTH Aachen - University of Technology, 52056 Aachen, Germany. [12] C. A. Ratanamahatana and E. Keogh, “Everything you know about Dynamic Time Warping is Wrong,” University of California, Riverside, CA 92521. [13] L. A. D. S. A. Molligoda and P. G. Wijayarathna, “APPLICABILITY OF HIDDEN MARKOV MODEL APPROACH FOR SINHALA SPEECH RECOGNITION - A SYSTEMATIC REVIEW,” University of Kelaniya. 37 [14] Z. Ghahramam, “An introduction to Hidden Markov Int. J. Pattern Recognit. Artif. Intell. [15] P. Dymarski, HIDDEN MARKOV MODELS, THEORY AND APPLICATIONS, First. India: InTech, 2011. [16] D. Reynolds, “Gaussian Mixture Models.” [17] M. K. H. Gunasekara and R. G. N. Meegama, “Real time Translation of Discrete Sinhala Speech to Unicode Text,” University of Sri Jayewardenep [18] T. Gulzar, A. Singh, and S. Sharma, “Comparative Analysis of LPCC, MFCC and BFCC for the Recognition of Hindi Words using Artificial Neural Networks,” Int. J. Comput. Appl., vol. Volume 101-No.l2, p. 6, Sep. 2014. [19] F. H onig, G. Stemmer, C. Hacker, and F. Brugnara, “Revising Perceptual Linear Prediction (PLP),” Universit at Erlangen-N“umberg, Germany. [20] U. Shrawankar, “TECHNIQUES FOR FEATURE EXTRACTION IN SPEECH RECOGNITION SYSTEM : A COMPARATIVE STUDY,” SGB Amravati University, Amravati. [21] U. Shrawankar and V. Thakare, “Feature Extraction for a Speech Recognition System in Noisy Environment: A Study,” 2010, pp. 358-361. [22] “Open-Source Large Vocabulary CSR Engine Julius.” [Online]. Available: http://julius.osdn.jp/en_index.php. [Accessed: 03-Feb-2016]. [23] M. A. Anusuya and S. K. Katti, “Speech Recognition by Machine: A Review,” Int. J. Comput. Sci. Inf. Secur., vol. Vol. 6, p. 25,2009. [24] K. Lee, Context-independent phonetic hidden Markov models for speaker- independent continuous speech recognition, vol. vol. 38,4 vols. 1990. [25] K. Lee, “Automatic speech recognition.” Boston,Mass: Kluwer, 1989. [26] “GenTXWarper - Mining gene expression time series.” . [27] “The Google app,” The Google app. [Online]. Available: https://www.google.com/search/about/. [Accessed: 04-Mar-2016]. [28] “iOS - SiriApple. [Online], Available: http://wxvw.apple.com/ios/siri/. [Accessed: 04-Mar-2016]. Model and Bayesian Networks,” MIT Lincoln Laboratory. ura. 38 [29] “What is Conan.?. Windows Holp," windows.™,(0„,inc]. Av,ilabte http://windows.microsoftcom/en-us/windows-10/getstarted-what-is-cortana. [Accessed: 04-Mar-2016]. [30] “Language Technology Research Laboratory” [Online], Available: http.//www,ucsc.cmb.ac.lk/ltrl/?page=downloads&la [Accessed: 04-Mar-2016], [31] “cmusphinx/pocketsphinx ” GitHub. [Online], Available: https://github.com/cmusphinx/pocketsphinx. [Accessed: 04-Mar-2016]. [32] “Training Acoustic Model For CMUSphinx [CMUSphinx Wiki] ” [Online], Available: http://cmusphinx.sourceforge.net/wiki/tutorialam. [Accessed: 04-Mar- 2016]. [33] “Audacity®.”. [34] “Cygwin.” [Online]. Available: https://www.cygwin.com/. [Accessed: 04-Mar- 2016]. ng=en&style=default. 39 Appendix A 1. SMS phrases for Greetings 2. SMS phrases for asking Questions 3. SMS phrases related to Relationshi 4. SMS phrases related to Students & E 5. SMS phrases to mention When & Where 6. SMS phrases for Invitations 7. SMS phrases for appreciation 8. SMS phrases for Emergency 9. SMS phrases to express feelings ps xams 40 Appendix B Page l of 1 Frequently Used SMS Phrases rr.x'""’-'"'..-“^sssksss: What are the frequently used SMS phrases for Greetings? Examples SecxtaE., «SI3J0=f. a* eg-arf, gs! -* E» s* ,E==f What are the frequently used SMS phrases to ask Questions? Examples- £a» 6a*. 2cs> e-.O tfexagec* 4*f5S0 edafa, 2a> aa»*e&{ eit, 2® sSsaf cafa>«. 2® What are the frequently used SMS phrases related to Relationships? Examples: 2a> SO e*»dQ;. 2? SS e*»dQ, SS 2®S »©j£saf e*»dS, Sjsf Safa sdi* 41 Appendix C Frequently (Responses) Fi!« Ed1 Vw<* Insert FefTOit OK) Too** fan * "■ ? ft£3 Ad*OM H.ij Ci1 N «. W ,jj *rU1 ’• • B t rt *.• s- <*> D K y - x - 2.Ti(P*jI*ts/ 0 « WhK *. .he frequently used SMS C*«e* ,o „* Questions? Ml *, „„ ^^ ? «* *=■<• t» ».C< «-.»*< jr-se- EJ JajC ,«£«- „,„3 M W -e'K-s-'incs. VA* n the feejetsiy '-1+e St.'S ?.'1!*| •*■*•- Ti S’lJem 1 Ea-1 ’ n-: »r*-r „• *5 ’•fmti -.r-i 3 5 _•) i £ai eii« f 3. e loi •*<*« »e»>n!< •»?. J-J, t 554 E!l( ns *»/ »5»*. d*r J3J- «-<» j*»s* f 3 *<*' *;;r5T *»*> > ffy* tf* Sii C-,1 ^ (*«!’ Wmn* /’ohwo Jf* u? , **>«* up Tn ( ^' I Iff.* y«l t 5 --i in»(( $rf»sr !5 JmS ir>Cnfrti:3 42 Appendix D \data\ ngram 1=578 ngram 2=3540 ngram 3=407 \1-grams: -5.2121 0-0.1680 -5.2121 1 -0.1680 -5.2121 2-0.1680 -5.2121 3 -0.1680 -5.2121 4-0.1680 -5.2121 5-0.1680 -5.2121 6-0.1680 -5.2121 7-0.1680 -5.2121 8-0.1680 -5.2121 9-0.1680 -0.5786 0.0000 -99.0000 -1.0147 -3.6439 ep°25)ca -0.4351 -3.3992 -0.2699 -4.2170 epazrfen 0.0000 -3.4412 €p2ad®<> -0.6011 -3.2078 epssfeazsf -0.7666 -4.1707 -0.1328 -3.3488 q©'2sf -0.2976 -1.9804 eft -0.3949 -4.2170 0.0000 -5.2121 c^Ossf -0.3009 43 -2.6619 -1.3828 -3.5589 cpzrfzS® -0.3010 -4.1707 -0.1657 -4.5131 cp2ft0o#©G32sf© -0.1680 -3.2436 c^®23 -0.6554 -3.3036 ep@2rf -0.4151 -4.5131 €fd©eaO 0.0000 -1.9793 cpB -0.1885 -2.7921 qQQ -0.3704 -1.9561 -0.5345 -2.8055 ep®232s> -0.8056 -4.2170 ef©25)255© 0.0000 -4.3670 cf®2s>ste -0.6451 44 Appendix E epcge'StfOzrf AAZ Y U B 00 V N SHZUB U DHZAAESHZN K R AA THZ RA R IY K DHZVAALK SHZAEN DHZAAEVK K 0 H 0 M DHZ BUDHZUSHZRNYI DHZVSHZK V EE V AA cg SIL SIL SIL ++CHAIRSQUEAK-H- ++C OUGH++ +NOISE+ +NOISE+ 49 Appendix I tracks/713-Audio_Track tracks/714-Audio_Track tracks/715-Audio_Track tracks/716-Audio_Track tracks/717-Audio_Track tracks/718-Audio_Track tracks/719-Audio_Track tracks/720-Audio_Track tracks/721 -AudioJTrack tracks/722-Audio__Track tracks/723- Audio_Track tracks/724-Audio_T rack tracks/725-Audio_Track tracks/726-Audio_Track tracks/727-Audio_Track tracks/728-Audio Track 50 Appendix J ©a s>0 Ulc n (1390.Audio Track) ®0 aO 8a»S utossf ®<;afa} (1391-Audio_Track) 0 (1392-Audio_Track) 1 (1393-Audio_Track) 2 (1394-Audio_Track) 3 (1395- Audio_Track) -H-SINGING-H- (noise_0001) -H-MOVEMENT+4- (noise_0002) ++TYPING++ (noise_0005) 51 Appendix K package edu.cmu.pocketsphinx.sinhala; import java.io.File; import java.util.concurrent.LinkedBlockingQueue; import android.media.AudioFormat; import android.media.AudioRecord; import android.media.MediaRecorder; import android.os.Bundle; import android.os.Environment; import android.util.Log; import edu.cmu.pocketsphinx.Config; import edu.cmu.pocketsphinx.Decoder; import edu.cmu.pocketsphinx.Hypothesis; import edu.cmu.pocketsphinx.pocketsphinx; public class RecognizerTask implements Runnable { class AudioTask implements Runnable { /** Queue on which audio blocks are placed. */ LinkedBlockingQueue q; AudioRecord rec; int block_size; boolean done; =1024;static final int DEFAULT_BLOCK_SIZE AudioTask() { this.init(new LinkedBlockin gQueue0. DEFAULT_BL0CK_S1ZE); } 52 AudioTask(LinkedBlockingQueue q) { this.init(q, DEFAULT_BLOCK_SIZE); } AudioTask(LinkedBlockingQueueq, int block_size) { this.init(q, block_size); } void init(LinkedBlockingQueue q, int block_size) { this, done = false; this.q = q; this.block_size = block_size; //HiepNH - CHANNEL_IN_MONO -> CHANNEL_IN_STEREO this.rec = new AudioRecord(MediaRecorder.AudioSource.DEFAULT, 16000, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODINGJPCM_16BIT, 8192); } public int getBlockSizeO { return block__size; } public void setBlockSize(int block_size) { this.block size = block_size; } LinkedBlockingQueue getQueueQ { public return q; } 53 public void stop() { this.done = true; } public void run() { this.rec.startRecordingO; while (! this.done) { int nshorts = this.readBlock(); if (nshorts <= 0) break; } this.rec.stopQ; this.rec.releaseQ; } int readBlock() { short[] buf = new short[this.block_size]; int nshorts = this.rec.read(buf, 0, buf.length); if (nshorts > 0) { Log.d(getClass0.getName(), "Posting " + nshorts +" samples to queue"); this.q.add(buf); } return nshorts; } } * PocketSphinx native decoder object. */ Decoder ps; /** 54 * Audio recording task. */ AudioTask audio; Thread associated with recording task. */ Thread audio_thread; /** * Queue of audio buffers. */ LinkedBlockingQueue audioq; /** Listener for recognition results. */ RecognitionListener rl; boolean usejpartials; enum State { IDLE, LISTENING }; enum Event { NONE, START, STOP, SHUTDOWN }; Event mailbox; public RecognitionListener getRecognitionListen rO { return rl; } r(RecognitionListener rl) { public void setRecognitionListene 55 this.rl = rl; } public void setUsePartials(boolean use_partials) { this.usejpartials = use_partials; } public boolean getUsePartials() { return this.use_partials; } public RecognizerTask(File sphinxDirectory) { pocketsphinx.setLogfile(sphinxDirectoiy.getAbsolutePathO+7pocketsphiiix.log"); Config c = new ConfigO; c.setString("-hmmM, sphinxDirectory V'/hmm/sinhala"); c.setString("-dict", sphinxDirectory + 7dict/test06.dic"); c.setString(M-lmu, sphinxDirectory + ,,/lm/test06.1m"); c.setString("-rawlogdir", sphinxDirectory.getAbsolutePathO); // Only use it to store the audio c.setFloat("-samprate", 16000.0); c.setlnt("-maxhmmpf2000); //c.setlnt(n-maxwpf', 10); //c.setInt("-pl_window", 2); //c.setBoolean(M-backtrace", true); //c.setBoolean(M-bestpath", false); this.ps = new Decoder(c); this.audio = null; this.audioq = new LinkedBlockingQueue0> this.use_jpartials = true; this.mailbox = Event.NONE; } public void run() { /* Main loop for this thread. */ 56 boolean done = false; /* State of the main loop. */ State state = State.IDLE; /* Previous partial hypothesis. */ String partialjhyp = null; while (!done) { Event todo = Event.NONE; synchronized (this.mailbox) { todo = this.mailbox; if (state = State.IDLE && todo = Event.NONE) { try { Log.d(getClass().getNameO, "waiting"); this.mailbox.waitO; todo = this.mailbox; Log.d(getClass().getNameO, "got" + todo); } catch (InterruptedException e) { /* Quit main loop. */ Log.e(getClass().getNameO, "Interrupted waiting for mailbox, shutting down"); todo = Event. SHUTDOWN; } } this.mailbox = Event.NONE; } switch (todo) { case NONE: if (state = State.IDLE) Log.e(getClass().getName(), "Rece ived NONE in mailbox when IDLE, threading error?"); 57 break; case START: if (state = State.IDLE) { Log.d(getClass().getName(), "START"); this.audio = new AudioTask(this.audioq, 1024); this.audiojhread = new Thread(this.audio); this.ps.startUtt(); this.audio_thread.start(); state = State.LISTENING; } else Log.e(getClass().getNameQ, "Received START in mailbox when LISTENING"); break; case STOP: if (state = State.IDLE) Log.e(getClass().getName(), "Received STOP in mailbox when IDLE"); else { Log.d(getClass().getNameO, "STOP"); assert this.audio != null; this.audio.stopQ; try { this.audio_thread.joinO; } catch (InterruptedException e) { Log.e(getClass0.getName(), "Interru pled waiting for audio thread, shutting down"); done = true; } short[] buf; while ((buf = this.audioq.poll0)!assnu® * 58 Log.d(getClass0.getNameO, "Reading " 8 + buf. length + " samples fromqueue"); this.ps.processRaw(buf, buf.length, false false); } this.ps.endllttO; this.audio = null; this.audio_thread = null; Hypothesis hyp = this.ps.getHyp(); if (this.rl != null) { if (hyp = null) { Log.d(getClass().getName05 "Recognition failure"); this.rl.onError(-l); } else { Bundle b = new Bundle(); Log.d(getClass()-getNameO, "Final hypothesis:" + hyp.getHypstrO); b.putString("hyp", hyp.getHypstrO); this.rl.onResults(b); } } state = State.IDLE; } break; case SHUTDOWN: Log.d(getClass0.getName(), "SHUTDOWN ), if (this.audio != null) { this.audio.stop(); assert this.audio_thread != null; try { this.audio thread.joinQ; } 59 catch (InterruptedException e) { } } this.ps.endUttO; this.audio = null; this.audio_thread = null; state = State.IDLE; done = true; break; } if (state = State.LISTENING) { assert this.audio != null; try { short[] buf = this.audioq.take(); Log.d(getClass().getNameO, "Reading " + buf.Iength + " samples from queue”); this.ps.processRaw(buf, buf.Iength, false, false); Hypothesis hyp = this.ps.getHypO; if (hyp != null) { String hypstr = hyp.getHypstrO; if (hypstr != partial_hyp) { Log.d(getClass().getName(), "Hypothesis:" + hyp.getHypstrO); if (this.rl != null && hyp != null) { Bundle b = new BundleOi b.putString("hyp", hyp.getHypstrO), this.rl.onPartialResults(b); } } partial_hyp = hypstr; } } catch (InterruptedException e) { Log.d(getClass().getName(), "In terrupted in audioq.take"); 60 }} } } public void start() { Log.d(getClass0.getNameO, "signalling START”); synchronized (this.mailbox) { this.mailbox.notifyAllO; Log.d(getClass().getName(), "signalled START"); this.mailbox = Event.START; } } public void stopO { Log.d(getClass().getNameO, "signalling STOP"); synchronized (this.mailbox) { this.mailbox.notifyAllO; Log.d(getClass0.getName(), "signalled STOP"); this.mailbox = Event.STOP; } } public void shutdownO { Log.d(getClass().getNameO, "signalling SHUTDOWN ), synchronized (this.mailbox) { this.mailbox.notifyAllO; Log.d(getClass().getNameO, "signalled SHUTDOWN"); this.mailbox = Event.SHUTDOWN; 61