BrightSide Workbench Full Report + Source Code
org.turro.elephant.entities.db.Synonyms Class Reference
Inheritance diagram for org.turro.elephant.entities.db.Synonyms:
Collaboration diagram for org.turro.elephant.entities.db.Synonyms:

Public Member Functions

Long getId ()
 
void setId (Long id)
 
Set< String > getWords ()
 
void setWords (Set< String > words)
 
boolean isEmpty ()
 
String getWordsString ()
 

Static Public Member Functions

static List< SynonymsgetSynonymsByWords (String phrase)
 
static List< SynonymsgetSynonyms (String word)
 
static List< SynonymsgetSynonyms (String word, int max)
 
static List< SynonymsgetSynonyms (Dao dao, String word)
 
static List< SynonymsgetSynonyms (Dao dao, String word, int max)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 44 of file Synonyms.java.

Member Function Documentation

◆ getId()

Long org.turro.elephant.entities.db.Synonyms.getId ( )

Definition at line 54 of file Synonyms.java.

54  {
55  return id;
56  }
Here is the caller graph for this function:

◆ getSynonyms() [1/4]

static List<Synonyms> org.turro.elephant.entities.db.Synonyms.getSynonyms ( Dao  dao,
String  word 
)
static

Definition at line 100 of file Synonyms.java.

100  {
101  return getSynonyms(dao, word, SQLUtil.MAX_SYNONIMS + 1);
102  }
static List< Synonyms > getSynonyms(String word)
Definition: Synonyms.java:92
Here is the call graph for this function:

◆ getSynonyms() [2/4]

static List<Synonyms> org.turro.elephant.entities.db.Synonyms.getSynonyms ( Dao  dao,
String  word,
int  max 
)
static

Definition at line 104 of file Synonyms.java.

104  {
105  WhereClause wc = new WhereClause();
106  wc.addClause("select s from Synonyms s");
107  wc.addClause("left join s.words w");
108  wc.addClause("where w like :word");
109  wc.addNamedValue("word", SQLHelper.convertToLike(word));
110  return max == 0 ? dao.getResultList(wc) : dao.getResultList(wc, max);
111  }
Here is the call graph for this function:

◆ getSynonyms() [3/4]

static List<Synonyms> org.turro.elephant.entities.db.Synonyms.getSynonyms ( String  word)
static

Definition at line 92 of file Synonyms.java.

92  {
93  return getSynonyms(new ElephantPU(), word);
94  }
Here is the caller graph for this function:

◆ getSynonyms() [4/4]

static List<Synonyms> org.turro.elephant.entities.db.Synonyms.getSynonyms ( String  word,
int  max 
)
static

Definition at line 96 of file Synonyms.java.

96  {
97  return getSynonyms(new ElephantPU(), word, max);
98  }
Here is the call graph for this function:

◆ getSynonymsByWords()

static List<Synonyms> org.turro.elephant.entities.db.Synonyms.getSynonymsByWords ( String  phrase)
static

Definition at line 82 of file Synonyms.java.

82  {
83  ArrayList<Synonyms> synonyms = new ArrayList<>();
84  if(!Strings.isBlank(phrase)) {
85  for(String word : phrase.split("\\s+")) {
86  synonyms.addAll(getSynonyms(new ElephantPU(), word));
87  }
88  }
89  return synonyms;
90  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getWords()

Set<String> org.turro.elephant.entities.db.Synonyms.getWords ( )

Definition at line 62 of file Synonyms.java.

62  {
63  return words;
64  }
Here is the caller graph for this function:

◆ getWordsString()

String org.turro.elephant.entities.db.Synonyms.getWordsString ( )

Definition at line 76 of file Synonyms.java.

76  {
77  return String.join(",", words);
78  }

◆ isEmpty()

boolean org.turro.elephant.entities.db.Synonyms.isEmpty ( )

Definition at line 72 of file Synonyms.java.

72  {
73  return words.isEmpty();
74  }
Here is the caller graph for this function:

◆ setId()

void org.turro.elephant.entities.db.Synonyms.setId ( Long  id)

Definition at line 58 of file Synonyms.java.

58  {
59  this.id = id;
60  }

◆ setWords()

void org.turro.elephant.entities.db.Synonyms.setWords ( Set< String >  words)

Definition at line 66 of file Synonyms.java.

66  {
67  this.words = words;
68  }

The documentation for this class was generated from the following file: