Package synalp.commons.utils.configuration

Examples of synalp.commons.utils.configuration.GeneratorConfiguration


  }


  private static void setProps(int file)
  {
    GeneratorConfiguration jeniConfig = GeneratorConfiguration.getConfig();
    try
    {
      switch (file)
      {
        case 1:
          String grammar_path = jeniConfig.getProperty(GeneratorConfiguration.GRAMMAR);
          if (grammar_path != null && !grammar_path.isEmpty())
          {
            System.out.println("The path of the grammar source file is : " + grammar_path + "\n");
            setProperty("grammar", "grammar_path");
            configureMenu();
          }
          else
          {
            System.out.println("The grammar source file is not defined.");
            setProperty("grammar", "grammar_path");
            configureMenu();
          }
          break;
        case 2:
          String lexicon_path = jeniConfig.getProperty(GeneratorConfiguration.LEXICON);
          if (lexicon_path != null && !lexicon_path.isEmpty())
          {
            System.out.println("The path of the syntactic lexicon source file is : " + lexicon_path + "\n");
            setProperty("syntactic lexicon", "lexicon_path");
            configureMenu();
View Full Code Here


  private static void setProperty(String file_type, String property_name) throws FileNotFoundException, IOException
  {
    String swValue = ConsoleUtils.inString("Would you like to configure it ? (Yes or No)");
    if (swValue.matches("Yes|yes|Y|y"))
    {
      GeneratorConfiguration jeniConfig = GeneratorConfiguration.getConfig();
      String swPath = ConsoleUtils.inString("Please enter the path of the " + file_type + " XML file :");
      // set the properties value
      jeniConfig.setProperty(property_name, swPath);
      // save properties to project root folder
      jeniConfig.save();
    }
    else if (swValue.matches("No|no|N|n"))
      configureMenu();
    else setProperty(file_type, property_name);
  }
View Full Code Here

TOP

Related Classes of synalp.commons.utils.configuration.GeneratorConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.