mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
32
Common/3dParty/hyphen/hyphen_test/build/input/de_DE
Normal file
32
Common/3dParty/hyphen/hyphen_test/build/input/de_DE
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
Geschwister
|
||||||
|
Nationen
|
||||||
|
Eichhörnchen
|
||||||
|
Schaffung
|
||||||
|
Projektkoordinatoren
|
||||||
|
Inhaltsverzeichnis
|
||||||
|
Gesellschaftliche
|
||||||
|
Zudem
|
||||||
|
Streichholzschachtel
|
||||||
|
Freundschaftsbeziehungen
|
||||||
|
Rührei
|
||||||
|
Arbeitslosigkeitsversicherung
|
||||||
|
Röntgen
|
||||||
|
Tschechien
|
||||||
|
Kreuzschlitzschraubenzieher
|
||||||
|
Bilderbuch
|
||||||
|
Glasperlen
|
||||||
|
abschreiben
|
||||||
|
Grüße
|
||||||
|
uneinig
|
||||||
|
Regenbogen
|
||||||
|
Freunde
|
||||||
|
Verzeichnis
|
||||||
|
Tag
|
||||||
|
Buch
|
||||||
|
Löschen
|
||||||
|
Freundschaft
|
||||||
|
Galerie
|
||||||
|
dokumentieren
|
||||||
|
Schaf
|
||||||
|
beeindruckend
|
||||||
|
blumentopferde
|
||||||
30
Common/3dParty/hyphen/hyphen_test/build/input/en_US
Normal file
30
Common/3dParty/hyphen/hyphen_test/build/input/en_US
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
hello
|
||||||
|
expedition
|
||||||
|
year
|
||||||
|
life
|
||||||
|
congratulations
|
||||||
|
president
|
||||||
|
amount
|
||||||
|
object
|
||||||
|
self-service
|
||||||
|
questions
|
||||||
|
summary
|
||||||
|
payments
|
||||||
|
algorithm
|
||||||
|
compound’s
|
||||||
|
occurrences
|
||||||
|
government
|
||||||
|
magazine
|
||||||
|
newspaper
|
||||||
|
time-out
|
||||||
|
clear-cut
|
||||||
|
water
|
||||||
|
about
|
||||||
|
devices
|
||||||
|
software
|
||||||
|
focus
|
||||||
|
follow-through
|
||||||
|
women
|
||||||
|
letter
|
||||||
|
famous
|
||||||
|
eagle
|
||||||
33
Common/3dParty/hyphen/hyphen_test/build/input/es_ES
Normal file
33
Common/3dParty/hyphen/hyphen_test/build/input/es_ES
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
Iatrogenia
|
||||||
|
Inconmensurable
|
||||||
|
Hipertricosis
|
||||||
|
Interlocutorio
|
||||||
|
Ininteligible
|
||||||
|
Hipermetropía
|
||||||
|
Incomprensible
|
||||||
|
Impredecible
|
||||||
|
Esternocleidomastoideo
|
||||||
|
Perro
|
||||||
|
Agua
|
||||||
|
Calle
|
||||||
|
Frío
|
||||||
|
Libro
|
||||||
|
Compra
|
||||||
|
Noche
|
||||||
|
Trabajo
|
||||||
|
Escuela
|
||||||
|
Comida
|
||||||
|
Montaña
|
||||||
|
Tiempo
|
||||||
|
Playa
|
||||||
|
Familia
|
||||||
|
Amigo
|
||||||
|
Sueño
|
||||||
|
Música
|
||||||
|
Viaje
|
||||||
|
Fiesta
|
||||||
|
Paralelepípedo
|
||||||
|
Anticonstitucionalmente
|
||||||
|
Amor
|
||||||
|
Feliz
|
||||||
|
Sol
|
||||||
1
Common/3dParty/hyphen/hyphen_test/build/input/fr_FR
Normal file
1
Common/3dParty/hyphen/hyphen_test/build/input/fr_FR
Normal file
@ -0,0 +1 @@
|
|||||||
|
Restaurant
|
||||||
34
Common/3dParty/hyphen/hyphen_test/build/input/ru_RU
Normal file
34
Common/3dParty/hyphen/hyphen_test/build/input/ru_RU
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
привет
|
||||||
|
проворный
|
||||||
|
тетрадь
|
||||||
|
фальшивый
|
||||||
|
кто-нибудь
|
||||||
|
спортзал
|
||||||
|
самосвал
|
||||||
|
трубопровод
|
||||||
|
аэропорт
|
||||||
|
человек
|
||||||
|
по-человечески
|
||||||
|
в-третьих
|
||||||
|
ворон
|
||||||
|
частый
|
||||||
|
лютик
|
||||||
|
дальнобойщик
|
||||||
|
родители
|
||||||
|
находим
|
||||||
|
выбираем
|
||||||
|
город
|
||||||
|
числовой
|
||||||
|
диапозон
|
||||||
|
пароль
|
||||||
|
призыв
|
||||||
|
однако
|
||||||
|
голубь
|
||||||
|
мужчина
|
||||||
|
достигнуть
|
||||||
|
открыла
|
||||||
|
молодой
|
||||||
|
человек
|
||||||
|
экспедиция
|
||||||
|
эмоции
|
||||||
|
большое
|
||||||
1
Common/3dParty/hyphen/hyphen_test/build/input/sv_SE
Normal file
1
Common/3dParty/hyphen/hyphen_test/build/input/sv_SE
Normal file
@ -0,0 +1 @@
|
|||||||
|
Komplicerad
|
||||||
32
Common/3dParty/hyphen/hyphen_test/build/output/de_DE
Normal file
32
Common/3dParty/hyphen/hyphen_test/build/output/de_DE
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
Ge=schwis=ter
|
||||||
|
Na=ti=o=nen
|
||||||
|
Eich=hörn=chen
|
||||||
|
Schaf=fung
|
||||||
|
Pro=jekt=ko=or=di=na=to=ren
|
||||||
|
In=halts=ver=zeich=nis
|
||||||
|
Ge=sell=schaft=li=che
|
||||||
|
Zu=dem
|
||||||
|
Streich=holz=schach=tel
|
||||||
|
Freund=schafts=be=zie=hun=gen
|
||||||
|
Rührei
|
||||||
|
Ar=beits=lo=sig=keits=ver=si=che=rung
|
||||||
|
Rönt=gen
|
||||||
|
Tsche=chi=en
|
||||||
|
Kreuz=schlitz=schrau=ben=zie=her
|
||||||
|
Bil=der=buch
|
||||||
|
Glas=per=len
|
||||||
|
ab=schrei=ben
|
||||||
|
Grü=ße
|
||||||
|
un=ei=nig
|
||||||
|
Re=gen=bo=gen
|
||||||
|
Freun=de
|
||||||
|
Ver=zeich=nis
|
||||||
|
Tag
|
||||||
|
Buch
|
||||||
|
Lö=schen
|
||||||
|
Freund=schaft
|
||||||
|
Ga=le=rie
|
||||||
|
do=ku=men=tie=ren
|
||||||
|
Schaf
|
||||||
|
be=ein=dru=ckend
|
||||||
|
blu=men=top=fer=de
|
||||||
30
Common/3dParty/hyphen/hyphen_test/build/output/en_US
Normal file
30
Common/3dParty/hyphen/hyphen_test/build/output/en_US
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
hello
|
||||||
|
ex=pe=di=tion
|
||||||
|
year
|
||||||
|
life
|
||||||
|
con=grat=u=la=tions
|
||||||
|
pres=i=dent
|
||||||
|
amount
|
||||||
|
ob=ject
|
||||||
|
self-ser=vice
|
||||||
|
ques=tions
|
||||||
|
sum=mary
|
||||||
|
pay=ments
|
||||||
|
al=go=rithm
|
||||||
|
com=pound’s
|
||||||
|
oc=cur=rences
|
||||||
|
gov=ern=ment
|
||||||
|
mag=a=zine
|
||||||
|
news=pa=per
|
||||||
|
time-out
|
||||||
|
clear-cut
|
||||||
|
wa=ter
|
||||||
|
about
|
||||||
|
de=vices
|
||||||
|
soft=ware
|
||||||
|
fo=cus
|
||||||
|
fol=low-through
|
||||||
|
women
|
||||||
|
let=ter
|
||||||
|
fa=mous
|
||||||
|
ea=gle
|
||||||
33
Common/3dParty/hyphen/hyphen_test/build/output/es_ES
Normal file
33
Common/3dParty/hyphen/hyphen_test/build/output/es_ES
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
Ia=tro=ge=nia
|
||||||
|
In=con=men=su=ra=ble
|
||||||
|
Hi=per=tri=co=sis
|
||||||
|
In=ter=lo=cu=to=rio
|
||||||
|
Inin=te=li=gi=ble
|
||||||
|
Hi=per=me=tro=pía
|
||||||
|
In=com=pren=si=ble
|
||||||
|
Im=pre=de=ci=ble
|
||||||
|
Es=ter=no=clei=do=mas=toi=deo
|
||||||
|
Pe=rro
|
||||||
|
Agua
|
||||||
|
Ca=lle
|
||||||
|
Frío
|
||||||
|
Li=bro
|
||||||
|
Com=pra
|
||||||
|
No=che
|
||||||
|
Tra=ba=jo
|
||||||
|
Es=cue=la
|
||||||
|
Co=mi=da
|
||||||
|
Mon=ta=ña
|
||||||
|
Tiem=po
|
||||||
|
Pla=ya
|
||||||
|
Fa=mi=lia
|
||||||
|
Ami=go
|
||||||
|
Sue=ño
|
||||||
|
Mú=si=ca
|
||||||
|
Via=je
|
||||||
|
Fies=ta
|
||||||
|
Pa=ra=le=le=pí=pe=do
|
||||||
|
Anti=cons=ti=tu=cio=nal=men=te
|
||||||
|
Amor
|
||||||
|
Fe=liz
|
||||||
|
Sol
|
||||||
32
Common/3dParty/hyphen/hyphen_test/build/output/fr_FR
Normal file
32
Common/3dParty/hyphen/hyphen_test/build/output/fr_FR
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
Res=tau=rant
|
||||||
|
Gou=ver=ne=ment
|
||||||
|
En=vi=ron=ne=ment
|
||||||
|
Mé=de=cin
|
||||||
|
Bi=blio=thé=co=no=mie
|
||||||
|
Tra=duc=tion
|
||||||
|
Il=lus=tra=tion
|
||||||
|
Ré=vo=lu=tion
|
||||||
|
Psy=cho=lo=gie
|
||||||
|
Pho=to=gra=phie
|
||||||
|
Ap=par=te=ment
|
||||||
|
Do=cu=ment
|
||||||
|
Or=di=na=teur
|
||||||
|
Ré=fri=gé=ra=teur
|
||||||
|
Mu=si=cien
|
||||||
|
At=ta=quer
|
||||||
|
Ef=fet
|
||||||
|
Oc=ca=sion
|
||||||
|
Ac=cé=lé=rer
|
||||||
|
Es=sen=tiel
|
||||||
|
Ex=cep=tion
|
||||||
|
Col=lec=tif
|
||||||
|
Suc=cès
|
||||||
|
Ap=pa=reil
|
||||||
|
L'évé=ne=ment
|
||||||
|
Mal=heu=reux
|
||||||
|
Dé=li=cieux
|
||||||
|
Tra=di=tion
|
||||||
|
Mal=heu=reu=se=ment
|
||||||
|
Spon=ta=né=ment
|
||||||
|
École
|
||||||
|
Bi=blio=thèque
|
||||||
34
Common/3dParty/hyphen/hyphen_test/build/output/ru_RU
Normal file
34
Common/3dParty/hyphen/hyphen_test/build/output/ru_RU
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
при=вет
|
||||||
|
про=вор=ный
|
||||||
|
тет=радь
|
||||||
|
фальши=вый
|
||||||
|
кто-нибудь
|
||||||
|
спорт=зал
|
||||||
|
само=свал
|
||||||
|
тру=бо=про=вод
|
||||||
|
аэро=порт
|
||||||
|
че=ло=век
|
||||||
|
по-чело=ве=че=ски
|
||||||
|
в-тре=тьих
|
||||||
|
во=рон
|
||||||
|
ча=стый
|
||||||
|
лю=тик
|
||||||
|
даль=но=бой=щик
|
||||||
|
ро=ди=те=ли
|
||||||
|
на=хо=дим
|
||||||
|
вы=би=ра=ем
|
||||||
|
го=род
|
||||||
|
чи=сло=вой
|
||||||
|
диа=по=зон
|
||||||
|
па=роль
|
||||||
|
при=зыв
|
||||||
|
од=на=ко
|
||||||
|
го=лубь
|
||||||
|
муж=чи=на
|
||||||
|
до=стиг=нуть
|
||||||
|
откры=ла
|
||||||
|
мо=ло=дой
|
||||||
|
че=ло=век
|
||||||
|
экс=пе=ди=ция
|
||||||
|
эмо=ции
|
||||||
|
большое
|
||||||
30
Common/3dParty/hyphen/hyphen_test/build/output/sv_SE
Normal file
30
Common/3dParty/hyphen/hyphen_test/build/output/sv_SE
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
Kom=pli=ce=rad
|
||||||
|
Till=för=lit=lig
|
||||||
|
Kon=kur=rens=kraf=tig
|
||||||
|
Om=sorgs=full
|
||||||
|
En=tu=si=as=tisk
|
||||||
|
Själv=stän=dig=het
|
||||||
|
Ex=pe=ri=men=tell
|
||||||
|
An=svars=full
|
||||||
|
Ut=bild=nings=pro=gram
|
||||||
|
Lämp=lig=het
|
||||||
|
Håll=bar=het
|
||||||
|
In=fly=tel=se=rik
|
||||||
|
Am=bi=tiös
|
||||||
|
Ut=forsk=ning
|
||||||
|
Själv=klar=het
|
||||||
|
Väst=kustskt
|
||||||
|
Sjuk=hus=per=so=nal
|
||||||
|
Kör=kort
|
||||||
|
Vän=skap=lig
|
||||||
|
Skämt=sam
|
||||||
|
Håll=bar=hets=rap=port
|
||||||
|
För=måns=be=skatt=ning
|
||||||
|
Rätts=sä=ker=hets=fråga
|
||||||
|
Ut=bild=nings=de=par=te=men=tet
|
||||||
|
Sjuk=vårds=råd=giv=ning
|
||||||
|
In=fra=struk=tur=pro=jekt
|
||||||
|
Till=gäng=lig=hets=an=pass=ning
|
||||||
|
Sär=skilt
|
||||||
|
Lång=va=rig
|
||||||
|
Kva=li=tets=kon=troll
|
||||||
@ -1,110 +1,149 @@
|
|||||||
#include <fstream>
|
#include <vector>
|
||||||
#include <iostream>
|
#include <cctype>
|
||||||
|
|
||||||
#include "./../js/src/ExportedFunctions.h"
|
#include "../../../../DesktopEditor/common/Directory.h"
|
||||||
|
#include "../../../../DesktopEditor/fontengine/TextHyphen.h"
|
||||||
|
#include "../../../../DesktopEditor/common/StringUTF32.h"
|
||||||
|
|
||||||
|
#define USE_DICTIONARIES_FROM_MEMORY
|
||||||
|
|
||||||
|
std::vector<std::wstring> ReadWords(const std::wstring& file)
|
||||||
|
{
|
||||||
|
std::vector<std::wstring> words;
|
||||||
|
|
||||||
|
NSFile::CFileBinary oFile;
|
||||||
|
if (!oFile.OpenFile(file))
|
||||||
|
return words;
|
||||||
|
|
||||||
|
int nInputDataLen = (int)oFile.GetFileSize();
|
||||||
|
char* pInputData = new char[nInputDataLen];
|
||||||
|
|
||||||
|
oFile.ReadFile((BYTE*)pInputData, (DWORD)nInputDataLen);
|
||||||
|
|
||||||
|
int nPos = 0;
|
||||||
|
if (nInputDataLen > 3 &&
|
||||||
|
((BYTE)pInputData[0] == 0xEF) && ((BYTE)pInputData[1] == 0xBB) && ((BYTE)pInputData[2]) == 0xBF)
|
||||||
|
{
|
||||||
|
nPos = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (nPos < nInputDataLen)
|
||||||
|
{
|
||||||
|
while (nPos < nInputDataLen && (pInputData[nPos] == '\n' || pInputData[nPos] == '\r'))
|
||||||
|
++nPos;
|
||||||
|
|
||||||
|
int nStart = nPos;
|
||||||
|
|
||||||
|
while (nPos < nInputDataLen && (pInputData[nPos] != '\n' && pInputData[nPos] != '\r'))
|
||||||
|
++nPos;
|
||||||
|
|
||||||
|
if (nPos > nStart)
|
||||||
|
{
|
||||||
|
std::string s(pInputData + nStart, nPos - nStart);
|
||||||
|
words.push_back(UTF8_TO_U(s));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
oFile.CloseFile();
|
||||||
|
RELEASEARRAYOBJECTS(pInputData);
|
||||||
|
return words;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::wstring HyphenWord(NSHyphen::CEngine& engine, const int& lang, const std::wstring& word)
|
||||||
|
{
|
||||||
|
std::string worda = U_TO_UTF8(word);
|
||||||
|
char* result = engine.Process(lang, worda.c_str(), (int)worda.length());
|
||||||
|
|
||||||
|
NSStringUtils::CStringUTF32 oInput = word;
|
||||||
|
NSStringUtils::CStringUTF32 oOutput;
|
||||||
|
|
||||||
|
int nCurrentIndex = 0;
|
||||||
|
int nPosHyphen = 0;
|
||||||
|
while (result[nPosHyphen] != 0)
|
||||||
|
{
|
||||||
|
if (1 == (result[nPosHyphen] & 1))
|
||||||
|
{
|
||||||
|
int nLenChunk = nPosHyphen - nCurrentIndex + 1;
|
||||||
|
oOutput += oInput.substr(nCurrentIndex, nLenChunk);
|
||||||
|
oOutput += '=';
|
||||||
|
nCurrentIndex += nLenChunk;
|
||||||
|
}
|
||||||
|
++nPosHyphen;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nCurrentIndex < oInput.length())
|
||||||
|
oOutput += oInput.substr(nCurrentIndex, oInput.length() - nCurrentIndex);
|
||||||
|
|
||||||
|
return oOutput.ToStdWString();
|
||||||
|
}
|
||||||
|
|
||||||
|
int GetLanguage(const std::wstring& sLanguage)
|
||||||
|
{
|
||||||
|
std::string sLang = U_TO_UTF8(sLanguage);
|
||||||
|
int nLang = 0;
|
||||||
|
for (int j = 0; j < NSTextLanguages::DictionaryRec_count; ++j)
|
||||||
|
{
|
||||||
|
if (std::string(NSTextLanguages::Dictionaries[j].m_name) == sLang)
|
||||||
|
{
|
||||||
|
nLang = NSTextLanguages::Dictionaries[j].m_lang;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nLang;
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
HyphenDict *dict;
|
NSHyphen::CEngine engine;
|
||||||
|
std::wstring dictionaries_dir = NSFile::GetProcessDirectory() + L"/../../../../../../dictionaries";
|
||||||
std::string dict_filename = PRO_DIR;
|
engine.Init(dictionaries_dir);
|
||||||
std::string words_filename = PRO_DIR;
|
|
||||||
std::string result_filename = PRO_DIR;
|
|
||||||
std::string dict_name = "en_US";
|
|
||||||
|
|
||||||
// set your filenames here
|
|
||||||
dict_filename += ("../../../../../dictionaries/" + dict_name + "/hyph_" + dict_name + ".dic");
|
|
||||||
words_filename += "words.txt";
|
|
||||||
result_filename += "result.txt";
|
|
||||||
|
|
||||||
// load the hyphenation dictionary
|
|
||||||
dict = hnj_hyphen_load(dict_filename.c_str());
|
|
||||||
|
|
||||||
std::ifstream fin(words_filename);
|
|
||||||
if(!fin.is_open())
|
|
||||||
{
|
|
||||||
std::cerr << "could not open " << words_filename << "!" << std::endl;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::ofstream fout(result_filename);
|
|
||||||
if(!fout.is_open())
|
|
||||||
{
|
|
||||||
std::cerr << "could not open " << result_filename << "!" << std::endl;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
while(!fin.eof())
|
|
||||||
{
|
|
||||||
char **rep = NULL;
|
|
||||||
int *pos = NULL;
|
|
||||||
int *cut = NULL;
|
|
||||||
|
|
||||||
std::string word;
|
|
||||||
|
|
||||||
fin >> word;
|
|
||||||
int n = word.size();
|
|
||||||
char *hword = new char[n * 2];
|
|
||||||
char *hyphens = new char[n + 5];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief
|
|
||||||
* input data:
|
|
||||||
*
|
|
||||||
* word: input word
|
|
||||||
* word_size: byte length of the input word
|
|
||||||
* hyphens: allocated character buffer (size = word_size + 5)
|
|
||||||
* hyphenated_word: allocated character buffer (size ~ word_size * 2) or NULL
|
|
||||||
* rep, pos, cut: pointers (point to the allocated and _zeroed_ buffers
|
|
||||||
* (size=word_size) or with NULL value) or NULL
|
|
||||||
*
|
|
||||||
* output data:
|
|
||||||
*
|
|
||||||
* hyphens: hyphenation vector (hyphenation points signed with odd numbers).
|
|
||||||
* hyphenated_word: hyphenated input word (hyphens signed with `=').
|
|
||||||
* optional (NULL input).
|
|
||||||
* rep: NULL (only standard hyph.), or replacements (hyphenation points
|
|
||||||
* signed with `=' in replacements).
|
|
||||||
* pos: NULL, or difference of the actual position and the beginning
|
|
||||||
* positions of the change in input words.
|
|
||||||
* cut: NULL, or counts of the removed characters of the original words
|
|
||||||
* at hyphenation.
|
|
||||||
*
|
|
||||||
* Note: rep, pos, cut are complementary arrays to the hyphens, indexed with the
|
|
||||||
* character positions of the input word.
|
|
||||||
*/
|
|
||||||
hnj_hyphen_hyphenate2(dict, word.c_str(), n, hyphens, hword, &rep, &pos, &cut);
|
|
||||||
|
|
||||||
fout << hword << ' ';
|
|
||||||
|
|
||||||
delete[] hword;
|
|
||||||
delete[] hyphens;
|
|
||||||
}
|
|
||||||
fin.close();
|
|
||||||
fout.close();
|
|
||||||
|
|
||||||
#if 1
|
|
||||||
|
|
||||||
CHyphenApplication* pApplication = hyphenCreateApplication();
|
|
||||||
|
|
||||||
FILE* fDictionary = fopen(dict_filename.c_str(), "rb");
|
|
||||||
fseek(fDictionary, 0, SEEK_END);
|
|
||||||
long lDictSize = ftell(fDictionary);
|
|
||||||
fseek(fDictionary, 0, SEEK_SET); /* same as rewind(f); */
|
|
||||||
|
|
||||||
char* pDictData = (char*)malloc(lDictSize);
|
|
||||||
fread(pDictData, (size_t)lDictSize, 1, fDictionary);
|
|
||||||
fclose(fDictionary);
|
|
||||||
|
|
||||||
int nResult = hyphenLoadDictionary(pApplication, pDictData, (unsigned int)lDictSize, dict_name.c_str());
|
|
||||||
|
|
||||||
free(pDictData);
|
|
||||||
|
|
||||||
char* pHyphenVector = hyphenWord(pApplication, "expedition", dict_name.c_str());
|
|
||||||
|
|
||||||
hyphenDestroyApplication(pApplication);
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
std::wstring sOneWord = HyphenWord(engine, 1033, L"expedition");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
std::wstring input_dir = NSFile::GetProcessDirectory() + L"/input";
|
||||||
|
std::wstring output_dir = NSFile::GetProcessDirectory() + L"/output";
|
||||||
|
std::vector<std::wstring> langs = NSDirectory::GetFiles(input_dir);
|
||||||
|
|
||||||
|
for (std::wstring& lang : langs)
|
||||||
|
{
|
||||||
|
std::wstring sLang = NSFile::GetFileName(lang);
|
||||||
|
int nLang = GetLanguage(sLang);
|
||||||
|
if (nLang == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
std::vector<std::wstring> words = ReadWords(lang);
|
||||||
|
if (words.empty())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
#ifdef USE_DICTIONARIES_FROM_MEMORY
|
||||||
|
BYTE* pData = NULL;
|
||||||
|
DWORD dwDataLen = 0;
|
||||||
|
std::wstring sFileDict = dictionaries_dir + L"/" + sLang + L"/hyph_" + sLang + L".dic";
|
||||||
|
if (NSFile::CFileBinary::ReadAllBytes(sFileDict, &pData, dwDataLen))
|
||||||
|
{
|
||||||
|
engine.LoadDictionary(nLang, pData, (unsigned int)dwDataLen);
|
||||||
|
RELEASEARRAYOBJECTS(pData);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
std::wstring sResult;
|
||||||
|
for (std::wstring& word : words)
|
||||||
|
{
|
||||||
|
sResult += HyphenWord(engine, nLang, word);
|
||||||
|
sResult += L"\r\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
std::wstring sOutputFile = output_dir + L"/" + sLang;
|
||||||
|
|
||||||
|
if (NSFile::CFileBinary::Exists(sOutputFile))
|
||||||
|
NSFile::CFileBinary::Remove(sOutputFile);
|
||||||
|
|
||||||
|
NSFile::CFileBinary::SaveToFile(sOutputFile, sResult, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -11,20 +11,7 @@ CORE_ROOT_DIR = $$PWD/../../../../../core
|
|||||||
PWD_ROOT_DIR = $$PWD
|
PWD_ROOT_DIR = $$PWD
|
||||||
|
|
||||||
include($$CORE_ROOT_DIR/Common/base.pri)
|
include($$CORE_ROOT_DIR/Common/base.pri)
|
||||||
|
ADD_DEPENDENCY(UnicodeConverter, kernel, graphics)
|
||||||
INCLUDEPATH += $$PWD_ROOT_DIR/../hyphen
|
|
||||||
|
|
||||||
DEFINES += PRO_DIR=\\\"$$PWD/\\\"
|
|
||||||
|
|
||||||
HEADERS += $$PWD_ROOT_DIR/../hyphen/hyphen.h
|
|
||||||
HEADERS += $$PWD_ROOT_DIR/../hyphen/hnjalloc.h
|
|
||||||
|
|
||||||
#SOURCES += $$PWD_ROOT_DIR/../hyphen/hyphen.c
|
|
||||||
SOURCES += $$PWD_ROOT_DIR/../hyphen/hnjalloc.c
|
|
||||||
|
|
||||||
SOURCES += \
|
|
||||||
../js/src/ExportedFunctions.cpp \
|
|
||||||
../js/src/HyphenApplication.cpp
|
|
||||||
|
|
||||||
SOURCES += main.cpp
|
SOURCES += main.cpp
|
||||||
|
|
||||||
|
|||||||
@ -172,6 +172,7 @@ Codec plugins handle the encoding and decoding of audio and video data, making i
|
|||||||
|
|
||||||
| Plugin name | Description |
|
| Plugin name | Description |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
|
| a52 | ATSC A/52 aka AC-3 audio decoder plugin |
|
||||||
| adpcm | ADPCM audio decoder |
|
| adpcm | ADPCM audio decoder |
|
||||||
| aes3 | AES3/SMPTE 302M audio decoder |
|
| aes3 | AES3/SMPTE 302M audio decoder |
|
||||||
| aom | AOM video decoder (AV1) |
|
| aom | AOM video decoder (AV1) |
|
||||||
@ -298,6 +299,7 @@ Demux plugins are responsible for demultiplexing multimedia containers, separati
|
|||||||
| real | Real Media format demuxer |
|
| real | Real Media format demuxer |
|
||||||
| smf | SMF demuxer |
|
| smf | SMF demuxer |
|
||||||
| subtitle | Demux for subtitle text files |
|
| subtitle | Demux for subtitle text files |
|
||||||
|
| ts | MPEG Transport Stream demuxer |
|
||||||
| tta | TTA demuxer |
|
| tta | TTA demuxer |
|
||||||
| ty | TY Stream audio/video demux |
|
| ty | TY Stream audio/video demux |
|
||||||
| vc1 | VC1 video demuxer |
|
| vc1 | VC1 video demuxer |
|
||||||
@ -353,6 +355,7 @@ The "misc" directory may contain miscellaneous plugins that don't fit neatly int
|
|||||||
| securetransport | TLS support for Mac OS X and iOS |
|
| securetransport | TLS support for Mac OS X and iOS |
|
||||||
| stats | Stats decoder/demuxer |
|
| stats | Stats decoder/demuxer |
|
||||||
| xdg_screensaver | XDG screen saver inhibition |
|
| xdg_screensaver | XDG screen saver inhibition |
|
||||||
|
| xml | XML Parser (using libxml2) |
|
||||||
|
|
||||||
### Packetizer plugins
|
### Packetizer plugins
|
||||||
|
|
||||||
@ -479,6 +482,7 @@ Video chroma plugins handle color space conversion and manipulation of video fra
|
|||||||
| i422_yuy2 | Conversions from I422 to YUY2,YUNV,YVYU,UYVY,UYNV,Y422,IUYV,Y211 |
|
| i422_yuy2 | Conversions from I422 to YUY2,YUNV,YVYU,UYVY,UYNV,Y422,IUYV,Y211 |
|
||||||
| i422_yuy2_sse2 | SSE2 conversions from I422 to YUY2,YUNV,YVYU,UYVY,UYNV,Y422,IUYV |
|
| i422_yuy2_sse2 | SSE2 conversions from I422 to YUY2,YUNV,YVYU,UYVY,UYNV,Y422,IUYV |
|
||||||
| rv32 | RV32 conversion filter |
|
| rv32 | RV32 conversion filter |
|
||||||
|
| swscale | Video scaling filter |
|
||||||
| yuvp | YUVP converter |
|
| yuvp | YUVP converter |
|
||||||
| yuy2_i420 | Conversions from YUY2,YUNV,YVYU,UYVY,UYNV,Y422 to I420 |
|
| yuy2_i420 | Conversions from YUY2,YUNV,YVYU,UYVY,UYNV,Y422 to I420 |
|
||||||
| yuy2_i422 | Conversions from YUY2,YUNV,YVYU,UYVY,UYNV,Y422 to I422 |
|
| yuy2_i422 | Conversions from YUY2,YUNV,YVYU,UYVY,UYNV,Y422 to I422 |
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user