-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
91 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
.Dd December 10, 2024 | ||
.Dt LT-MERGE 1 | ||
.Os Apertium | ||
.Sh NAME | ||
.Nm lt-merge | ||
.Nd lexical merger for Apertium | ||
.Sh SYNOPSIS | ||
.Nm lt-merge | ||
.Op Fl u | ||
.Op Ar input_file Op Ar output_file | ||
.Sh DESCRIPTION | ||
.Nm lt-merge | ||
is the application responsible for merging and unmerging | ||
lexical units | ||
.Pp | ||
It accomplishes this. | ||
.Sh OPTIONS | ||
.Bl -tag -width Ds | ||
.It Fl u , Fl Fl unmerge | ||
Run in reverse, this splits previously merged words. | ||
.It Fl v , Fl Fl version | ||
Display the version number. | ||
.It Fl h , Fl Fl help | ||
Display this help. | ||
.El | ||
\" .Sh FILES | ||
\" .Bl -tag -width Ds | ||
\" .It Ar input_file | ||
\" The input compiled dictionary. | ||
\" .El | ||
.Sh SEE ALSO | ||
.Xr apertium 1 , | ||
.Xr lt-proc 1 | ||
.Sh COPYRIGHT | ||
Copyright \(co 2024 Universitat d'Alacant / Universidad de Alicante. | ||
This is free software. | ||
You may redistribute copies of it under the terms of | ||
.Lk https://www.gnu.org/licenses/gpl.html the GNU General Public License . | ||
.Sh BUGS | ||
Many... lurking in the dark and waiting for you! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright (C) 2024 Universitat d'Alacant / Universidad de Alicante | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License as | ||
* published by the Free Software Foundation; either version 2 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
#include <lttoolbox/fst_processor.h> | ||
#include <lttoolbox/file_utils.h> | ||
#include <lttoolbox/cli.h> | ||
#include <lttoolbox/lt_locale.h> | ||
#include <iostream> | ||
|
||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
LtLocale::tryToSetLocale(); | ||
CLI cli("merge lexical units from the one tagged BEG until END", PACKAGE_VERSION); | ||
cli.add_file_arg("input_file"); | ||
cli.add_file_arg("output_file"); | ||
cli.add_bool_arg('u', "unmerge", "Undo the merge"); | ||
cli.parse_args(argc, argv); | ||
|
||
auto strs = cli.get_strs(); | ||
bool unmerge = cli.get_bools()["unmerge"]; | ||
InputFile input; | ||
if (!cli.get_files()[1].empty()) { | ||
input.open_or_exit(cli.get_files()[0].c_str()); | ||
} | ||
UFILE* output = openOutTextFile(cli.get_files()[1]); | ||
|
||
FSTProcessor fstp; | ||
fstp.initBiltrans(); | ||
fstp.quoteMerge(input, output); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters