Class Lexicon
java.lang.Object
org.episteme.social.linguistics.Lexicon
- All Implemented Interfaces:
Serializable, Named
Represents a lexicon - a dictionary of lexemes with definitions.
A lexicon maps lexemes (abstract word units) to their definitions for a specific language. * @see Lexicon (Wikipedia)
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears all entries.booleanChecks if a word is in the lexicon.Gets a lexeme by canonical form.getDefinition(String word) Gets the definition for a word.Returns the language.Returns all lexemes.getName()getWords()Returns all words in the lexicon.booleanisEmpty()Checks if the lexicon is empty.voidAdds a word with definition.voidAdds a lexeme with definition.Removes a lexeme.voidsetLanguage(Language language) Sets the language.voidSets the lexicon name.intsize()Returns the number of entries.toString()
-
Constructor Details
-
Lexicon
public Lexicon()Creates an empty lexicon. -
Lexicon
-
Lexicon
-
-
Method Details
-
getName
-
setName
-
getLanguage
-
setLanguage
-
put
Adds a lexeme with definition.- Parameters:
lexeme- the lexemedefinition- the meaning- Throws:
IllegalArgumentException- if language mismatch
-
put
-
get
-
getDefinition
-
contains
Checks if a word is in the lexicon.- Parameters:
word- the word- Returns:
- true if present
-
remove
-
getWords
-
getLexemes
-
size
public int size()Returns the number of entries.- Returns:
- entry count
-
isEmpty
public boolean isEmpty()Checks if the lexicon is empty.- Returns:
- true if empty
-
clear
public void clear()Clears all entries. -
toString
-