public static synchronized boolean createGrammarInASingleLine(String text){
        boolean isGrammarCreatedSuccessfully = false;
        // Only proceed if the data is valid
        if(text != null){
            // Only leave text and numbers
            text = FileUtils.getTextAndDigits(text);
            // Create the body of the Grammar
            StringBuilder grammar = new StringBuilder("#JSGF V1.0" + EnvironmentUtils.NEW_LINE +
                    "grammar " + SpeechManager.GRAMMAR + ";" + EnvironmentUtils.NEW_LINE);
            grammar.append("public <all_line> =");
            StringBuilder list = new StringBuilder();
            int counter = 0;
            for(String line : text.split("\n")){
                line = line.trim();
                if(!line.isEmpty()){
                    list.append("<line_").append(++counter).append("> = ").append(line.trim()).append(";").append(EnvironmentUtils.NEW_LINE);
                    grammar.append(" <line_").append(counter).append(">");
                }
            }
            grammar.append(";").append(EnvironmentUtils.NEW_LINE);
            grammar.append(list.toString());
            try{
                // If the temp file does not exists then create it
                File temp = new File(SpeechManager.DIRECTORY);
                if(!temp.exists()){
                    if(!temp.mkdir()){ throw new IOException("[" + SpeechManager.DIRECTORY + "] directory cannot be created!"); }
                    else{ temp.deleteOnExit(); } // If this method creates this directory then ensure to delete it when exiting the JVM
                }
                // Create the document to store the Grammar
                File file = new File(SpeechManager.DIRECTORY + EnvironmentUtils.SEPARATOR + SpeechManager.GRAMMAR_FILE);
                // Delete this file when exiting the JVM
                file.deleteOnExit();
                // Write the Grammar into the document
                BufferedWriter bw = new BufferedWriter(new FileWriter(file.getAbsoluteFile()));
                bw.write(grammar.toString());
                bw.close();
                // The Grammar was created successfully
                isGrammarCreatedSuccessfully = true;
            }catch(Exception e){ e.printStackTrace(); }
        }
        return isGrammarCreatedSuccessfully;
    }