Class ArticleService


  • public final class ArticleService
    extends java.lang.Object
    Provides methods to classify words. It is necessary because there's a need to check if a word is or not an article, in addition to having a whole articles' dataset powering up the text generation at its maximum. It was chosen to be static because there is no need to have another instance of this class in an application.
    Since:
    1.0 SNAPSHOT
    Author:
    Arthur Brenno
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Set<java.lang.String> commonArticles()
      Getter.
      static java.lang.String getRandom()
      Gets a random article from the commonArticles Set.
      static boolean isArticle​(@NotNull java.lang.String word)
      Checks if a word is an article.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • commonArticles

        public static java.util.Set<java.lang.String> commonArticles()
        Getter.
        Returns:
        commonArticles Set.
      • isArticle

        public static boolean isArticle​(@NotNull
                                        @NotNull java.lang.String word)
        Checks if a word is an article.
        Parameters:
        word - to be checked (will be converted to lower-case).
        Returns:
        true if the word is an article, false if not.
      • getRandom

        public static java.lang.String getRandom()
        Gets a random article from the commonArticles Set.
        Returns:
        random article.