Package org.codelibs.fess.dict.mapping
Class CharMappingFile
java.lang.Object
org.codelibs.fess.dict.DictionaryFile<CharMappingItem>
org.codelibs.fess.dict.mapping.CharMappingFile
Character mapping file handler for managing character mapping dictionaries.
This class provides functionality to load, parse, and manage character mapping
rules that define how input characters should be transformed to output characters
during text analysis and search processing.
Character mapping files contain mapping rules in the format:
input1,input2,... => output
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classInner class for handling updates to the character mapping file.Nested classes/interfaces inherited from class org.codelibs.fess.dict.DictionaryFile
DictionaryFile.PagingList<E> -
Field Summary
Fields inherited from class org.codelibs.fess.dict.DictionaryFile
dictionaryManager, id, path, timestamp -
Constructor Summary
ConstructorsConstructorDescriptionCharMappingFile(String id, String path, Date timestamp) Constructs a new CharMappingFile instance. -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete(CharMappingItem item) Deletes a character mapping item from the dictionary file.org.dbflute.optional.OptionalEntity<CharMappingItem> get(long id) Retrieves a character mapping item by its ID.getPath()Returns the file path of this character mapping dictionary.Returns the simple file name (without directory path) of this mapping file.getType()Returns the type identifier for this dictionary file.voidinsert(CharMappingItem item) Inserts a new character mapping item into the dictionary file.protected voidreload(CharMappingFile.MappingUpdater updater) Reloads the character mapping items from the dictionary file.protected voidreload(CharMappingFile.MappingUpdater updater, InputStream in) Reloads the character mapping items from the provided input stream.selectList(int offset, int size) Retrieves a paginated list of character mapping items.toString()Returns a string representation of this character mapping file.voidupdate(InputStream in) Updates the entire mapping file content from the provided input stream.voidupdate(CharMappingItem item) Updates an existing character mapping item in the dictionary file.Methods inherited from class org.codelibs.fess.dict.DictionaryFile
getId, getTimestamp, manager, writeOut
-
Constructor Details
-
CharMappingFile
Constructs a new CharMappingFile instance.- Parameters:
id- the unique identifier for this mapping filepath- the file path to the character mapping dictionarytimestamp- the last modification timestamp of the file
-
-
Method Details
-
getType
Returns the type identifier for this dictionary file.- Specified by:
getTypein classDictionaryFile<CharMappingItem>- Returns:
- the string "mapping" identifying this as a character mapping file
-
getPath
Returns the file path of this character mapping dictionary.- Overrides:
getPathin classDictionaryFile<CharMappingItem>- Returns:
- the file path as a string
-
get
Retrieves a character mapping item by its ID.- Specified by:
getin classDictionaryFile<CharMappingItem>- Parameters:
id- the unique identifier of the mapping item to retrieve- Returns:
- an OptionalEntity containing the mapping item if found, empty otherwise
-
selectList
Retrieves a paginated list of character mapping items.- Specified by:
selectListin classDictionaryFile<CharMappingItem>- Parameters:
offset- the starting index for pagination (0-based)size- the maximum number of items to return- Returns:
- a PagingList containing the requested subset of mapping items
-
insert
Inserts a new character mapping item into the dictionary file.- Specified by:
insertin classDictionaryFile<CharMappingItem>- Parameters:
item- the character mapping item to insert
-
update
Updates an existing character mapping item in the dictionary file.- Specified by:
updatein classDictionaryFile<CharMappingItem>- Parameters:
item- the character mapping item to update
-
delete
Deletes a character mapping item from the dictionary file.- Specified by:
deletein classDictionaryFile<CharMappingItem>- Parameters:
item- the character mapping item to delete
-
reload
Reloads the character mapping items from the dictionary file.- Parameters:
updater- the mapping updater to use for writing changes, or null for read-only reload
-
reload
Reloads the character mapping items from the provided input stream. Parses mapping rules in the format: input1,input2,... => output- Parameters:
updater- the mapping updater to use for writing changes, or null for read-only reloadin- the input stream to read the mapping data from
-
getSimpleName
Returns the simple file name (without directory path) of this mapping file.- Returns:
- the file name without the full path
-
update
Updates the entire mapping file content from the provided input stream.- Parameters:
in- the input stream containing the new mapping file content- Throws:
IOException- if an I/O error occurs during the update
-
toString
Returns a string representation of this character mapping file.
-