package eg;

import eg.utils.FileUtils;

/**
 * The selection of the language based on a filename.
 * <p>
 * This method {@link #selectLanguage(String)} has to be modified
 * if a another Language is being added in {@link Languages}
 */
public class LanguageSelector {
   
   /**
    * Returns a language based on the extension of the specified file
    *
    * @param file  the file
    * @return  a language from {@link Languages}
    */ 
   public static Languages selectLanguage(String file) {
      String ext = FileUtils.fileExtension(file);
      Languages lang;
      switch (ext) {
         case "java":
            lang = Languages.JAVA;
            break;
         case "html": case "htm":
            lang = Languages.HTML;
            break;
         case "js":
            lang = Languages.JAVASCRIPT;
            break;
         case "css":
            lang = Languages.CSS;
            break;
         case "pl": case "pm":
            lang = Languages.PERL;
            break;
         case "R":
            lang = Languages.R;
            break;
         case "xml": case "fxml":
            lang = Languages.XML;
            break;
         default:
            lang = Languages.NORMAL_TEXT;
      }
      return lang;
   }
}

@@ -84,153 +84,26 @@
  on 
-a
+the
  file
-name.%0A * %3Cp%3E%0A * This method %7B@link #selectLanguage(String)%7D has to be modified%0A * if a another Language is being added in %7B@link Languages%7D
+ extension
 %0A */
@@ -269,41 +269,20 @@
 rn  
-a language from %7B@link L
+the l
 anguage
-s%7D
 %0A   

make changes in javadoc