Compare commits
25 Commits
v0.1.1
...
v0.3.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2bb7ca6ccd | ||
|
|
2610d98ae1 | ||
|
|
32d533ff61 | ||
|
|
ac68a20697 | ||
|
|
0b90141dcd | ||
|
|
5bc5711f09 | ||
|
|
00411f015c | ||
|
|
ab9799b273 | ||
|
|
d8dbc66b27 | ||
|
|
08ed8866d0 | ||
|
|
620d0ef9de | ||
|
|
312d38ac6d | ||
|
|
4aec0e4e9a | ||
|
|
4f1002ee2d | ||
|
|
f291891139 | ||
|
|
230cefb85d | ||
|
|
84df8142c6 | ||
|
|
38e45c4f60 | ||
|
|
221f4e59e1 | ||
|
|
8ccafd5c0c | ||
|
|
59fcf3e2f0 | ||
|
|
59cc61105a | ||
|
|
ea438a7f40 | ||
|
|
1cb2bac407 | ||
|
|
5d2da18255 |
BIN
NewLennon.png
Normal file
BIN
NewLennon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 228 KiB |
133
README.md
Normal file
133
README.md
Normal file
@@ -0,0 +1,133 @@
|
||||
# NMSlib
|
||||
|
||||
NMSlib is a GoLang package for dealing with converting Galactic coordinates to Portal codes and vice versa.
|
||||
|
||||
NMSlib also translates known Korvax words to English and back.
|
||||
- Gek, Vykeen, etc will be added in the future
|
||||
|
||||
## Installation
|
||||
|
||||
To install this module use `go get`
|
||||
|
||||
|
||||
```bash
|
||||
go get -u gitlab.com/bradley.richins/nmslib
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
**Example:**
|
||||
|
||||
```golang
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"gitlab.com/bradley.richins/nmslib"
|
||||
)
|
||||
|
||||
func main() {
|
||||
portalcode := "006afa556c30"
|
||||
tstvar, err := nmslib.P2gc(portalcode)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Printf("Input:\t%s\nExpecting:\t042F:0079:0D55:006A\nHave:\t%s\n", portalcode, tstvar)
|
||||
|
||||
nmslib.CreateBanner(portalcode, "NewLennon.png", 0)
|
||||
|
||||
fmt.Println(Translate{"KIHTYOMOLES"}.Kor2Eng())
|
||||
korvax := Translate{"Contraband"}
|
||||
fmt.Println(korvax.Eng2Kor())
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
### Creating a Glyph banner with CreateBanner()
|
||||
|
||||
This function takes 3 parameters:
|
||||
|
||||
* portalcode: 12 char hex string of portal location
|
||||
* savename: Save location and name
|
||||
* Horizontal/Vertical layout: 0 is horizontal, 1 is vertical
|
||||
|
||||
**Example:**
|
||||
|
||||
Horizontal Layout for Galactic Hub [HUB10-6A Icarus Sun](https://nomanssky.gamepedia.com/HUB10-6A_Icarus_Sun) Eniwa 68/L3
|
||||
|
||||
```golang
|
||||
nmslib.CreateBanner("006afa556c30", "NewLennon.png", 0)
|
||||
```
|
||||
|
||||

|
||||
|
||||
### Converting Portal code to Galactic address with P2gc()
|
||||
|
||||
This function only takes 1 parameter and returns a string
|
||||
|
||||
* portalcode: 12 char hex string of portal glyphs
|
||||
|
||||
**Example:**
|
||||
|
||||
```golang
|
||||
ga, _ := nmslib.P3gc("006afa556c30")
|
||||
fmt.Println(ga)
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
``042F:0079:0D55:006A``
|
||||
|
||||
### Converting Galactic coordinates to Portal codes with Gc2p()
|
||||
|
||||
This function only takes 1 parameter and returns a string
|
||||
|
||||
* galacticaddress: 16 char 4 block hex address
|
||||
|
||||
**Example:**
|
||||
|
||||
```golang
|
||||
pc, _ := nmslib.P3gc("042F:0079:0D55:006A")
|
||||
fmt.Println(pc)
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
``006AFA556C30``
|
||||
|
||||
### Translate Korvax to English with Korvax2Eng()
|
||||
|
||||
This function takes only 1 parameter and returns a string
|
||||
|
||||
* korvaxword: Any known Korvaxen word (ex. eapoluch)
|
||||
|
||||
**Example:**
|
||||
|
||||
```golang
|
||||
fmt.Println(Translate{"KIHTYOMOLES"}.Kor2Eng())
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
``CONTRABAND``
|
||||
|
||||
### Translate English to Korvax with Eng2Korvax()
|
||||
|
||||
This function takes only 1 parameter and returns a string
|
||||
|
||||
* engword: English word to attempt conversion
|
||||
|
||||
**Example:**
|
||||
|
||||
```golang
|
||||
korvax := Translate{"Contraband"}
|
||||
fmt.Println(korvax.Eng2Kor())
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
``Zelidovoso``
|
||||
|
||||
## License
|
||||
[MIT](COPYING)
|
||||
17
convert.go
17
convert.go
@@ -70,22 +70,23 @@ func P2gc(p string) (gc string, err error) {
|
||||
|
||||
/*
|
||||
Gc2p - Galactic coordinates to portal code
|
||||
Requires 1 string and returns a string and error
|
||||
Requires 1 string and 1 int returns a string and error
|
||||
var gc string
|
||||
Galactic address (ex. 042F:0079:0D55:006A)
|
||||
var p int
|
||||
Planet ID [1-6]
|
||||
Return var string
|
||||
Portal Glyph hex string 12 chars in len (ex. 006afa556c30)
|
||||
*/
|
||||
func Gc2p(gc string) (portalcode string, err error) {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
/*TODO: add option for Planet choice (1-6)*/
|
||||
func Gc2p(gc string, p int) (portalcode string, err error) {
|
||||
// split and store string
|
||||
// coords[0] == X; coords[1] == Y coords[2] == Z;
|
||||
// coords[3] == SSI coords[4] == P
|
||||
coords := strings.Split(gc+":1", ":")
|
||||
if p > 6 {
|
||||
p = 1
|
||||
}
|
||||
nustring := fmt.Sprintf("%s:%d", gc, p)
|
||||
coords := strings.Split(nustring, ":")
|
||||
for n := 0; n < len(coords); n++ {
|
||||
portalcode = portalcode + coords[n]
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ import (
|
||||
"os"
|
||||
"strconv"
|
||||
|
||||
"github.com/nfnt/resize"
|
||||
|
||||
gim "github.com/ozankasikci/go-image-merge"
|
||||
)
|
||||
|
||||
@@ -24,6 +26,16 @@ func CreateBanner(portalhex string, savename string, vopt int) {
|
||||
var err error
|
||||
var GlyphHex [12]int64
|
||||
var glyphImg [12]string
|
||||
var vert int
|
||||
var horz int
|
||||
|
||||
// Setup temp dir
|
||||
tempdir, err := ioutil.TempDir("", "nmslib-")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer os.RemoveAll(tempdir)
|
||||
|
||||
// verify len of portalhex
|
||||
if len(portalhex) == 12 {
|
||||
// get hex value from each digit in given string to an array of int64
|
||||
@@ -35,7 +47,7 @@ func CreateBanner(portalhex string, savename string, vopt int) {
|
||||
}
|
||||
// assign image location of its glyph hex value to an array of strings
|
||||
for j := 0; j < len(glyphImg); j++ {
|
||||
glyphImg[j] = fmt.Sprintf("tmp.nmslib/glyphs/GLYPH-%X.png", GlyphHex[j])
|
||||
glyphImg[j] = fmt.Sprintf("glyphs/GLYPH-%X.png", GlyphHex[j])
|
||||
}
|
||||
// pull images need from glyph.go and saved them to ./glyphs/
|
||||
for k := 0; k < len(glyphImg); k++ {
|
||||
@@ -43,49 +55,47 @@ func CreateBanner(portalhex string, savename string, vopt int) {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
_, err2 := os.Stat("tmp.nmslib/glyphs")
|
||||
_, err2 := os.Stat(tempdir + "/glyphs/")
|
||||
if os.IsNotExist(err2) {
|
||||
errDir := os.MkdirAll("tmp.nmslib/glyphs", 0755)
|
||||
errDir := os.MkdirAll(tempdir+"/glyphs", 0755)
|
||||
if errDir != nil {
|
||||
panic(errDir)
|
||||
}
|
||||
}
|
||||
err = ioutil.WriteFile(glyphImg[k], []byte(data), 0644)
|
||||
|
||||
err = ioutil.WriteFile(tempdir+"/"+glyphImg[k], []byte(data), 0644)
|
||||
}
|
||||
}
|
||||
// load images for processing using github.com/ozankasikci/go-image-merge
|
||||
grids := []*gim.Grid{
|
||||
{ImageFilePath: glyphImg[0]}, {ImageFilePath: glyphImg[1]},
|
||||
{ImageFilePath: glyphImg[2]}, {ImageFilePath: glyphImg[3]},
|
||||
{ImageFilePath: glyphImg[4]}, {ImageFilePath: glyphImg[5]},
|
||||
{ImageFilePath: glyphImg[6]}, {ImageFilePath: glyphImg[7]},
|
||||
{ImageFilePath: glyphImg[8]}, {ImageFilePath: glyphImg[9]},
|
||||
{ImageFilePath: glyphImg[10]}, {ImageFilePath: glyphImg[11]},
|
||||
{ImageFilePath: tempdir + "/" + glyphImg[0]}, {ImageFilePath: tempdir + "/" + glyphImg[1]},
|
||||
{ImageFilePath: tempdir + "/" + glyphImg[2]}, {ImageFilePath: tempdir + "/" + glyphImg[3]},
|
||||
{ImageFilePath: tempdir + "/" + glyphImg[4]}, {ImageFilePath: tempdir + "/" + glyphImg[5]},
|
||||
{ImageFilePath: tempdir + "/" + glyphImg[6]}, {ImageFilePath: tempdir + "/" + glyphImg[7]},
|
||||
{ImageFilePath: tempdir + "/" + glyphImg[8]}, {ImageFilePath: tempdir + "/" + glyphImg[9]},
|
||||
{ImageFilePath: tempdir + "/" + glyphImg[10]}, {ImageFilePath: tempdir + "/" + glyphImg[11]},
|
||||
}
|
||||
if vopt == 1 {
|
||||
// Merge images horizontally
|
||||
rgba, err := gim.New(grids, 1, 12).Merge()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
// save the output to png
|
||||
fmt.Printf("Saving %s to %s in vertical format\n", portalhex, savename)
|
||||
file, err := os.Create(savename)
|
||||
err = png.Encode(file, rgba)
|
||||
} else {
|
||||
// Merge images vertically
|
||||
rgba, err := gim.New(grids, 12, 1).Merge()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
// save the output to png
|
||||
fmt.Printf("Saving %s to %s\n", portalhex, savename)
|
||||
file, err := os.Create(savename)
|
||||
err = png.Encode(file, rgba)
|
||||
|
||||
if vopt == 1 { // set vertical rendering
|
||||
vert, horz = 1, 12
|
||||
} else { // set horizontal rendering (default)
|
||||
vert, horz = 12, 1
|
||||
}
|
||||
// remove glyphs folder to keep it clean
|
||||
errDir := os.RemoveAll("tmp.nmslib/glyphs")
|
||||
if errDir != nil {
|
||||
panic(errDir)
|
||||
|
||||
// create new image from grids
|
||||
rgba, err := gim.New(grids, vert, horz).Merge()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// Resize banner 768x64
|
||||
nuimg := resize.Resize(768, 64, rgba, resize.Lanczos3)
|
||||
|
||||
// save the output to png
|
||||
fmt.Printf("Saving %s to %s\n", portalhex, savename)
|
||||
file, err := os.Create(savename)
|
||||
err = png.Encode(file, nuimg)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
}
|
||||
|
||||
5
go.mod
5
go.mod
@@ -2,4 +2,7 @@ module gitlab.com/bradley.richins/nmslib
|
||||
|
||||
go 1.15
|
||||
|
||||
require github.com/ozankasikci/go-image-merge v0.2.2
|
||||
require (
|
||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
|
||||
github.com/ozankasikci/go-image-merge v0.2.2
|
||||
)
|
||||
|
||||
2
go.sum
2
go.sum
@@ -1,2 +1,4 @@
|
||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ=
|
||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8=
|
||||
github.com/ozankasikci/go-image-merge v0.2.2 h1:K370BLLTIsamwjAeViiPntf7GiG3h9pXzDmxXCbN8/0=
|
||||
github.com/ozankasikci/go-image-merge v0.2.2/go.mod h1:NQ2aN0b21buFx3p+5x4dZrKuPSLh2uBukK7F30BrYTo=
|
||||
|
||||
679
korvax-lang.csv
679
korvax-lang.csv
@@ -1,679 +0,0 @@
|
||||
rare,vaiut,Hik,
|
||||
warning,durenise,Ashkar,
|
||||
korvax,itelis,Bokhodim,
|
||||
convergence,nozavolochen,Tetyevolgove,
|
||||
toxic,vozd,Yundal,Teyug
|
||||
calm,vanog,Ekt,
|
||||
traveller,kostalymusk,Zazhelekal,
|
||||
probability,mavirsakhta,Urzhegodovu,
|
||||
please,stvovat,Vochiuh,
|
||||
high,len,Biazy,Rutyu
|
||||
time,viati,Avash,
|
||||
scared,ebakim,Oobsk,
|
||||
virus,layevk,Ognit,
|
||||
echoes,turyin,Inach,
|
||||
data,aishi,Ovu,Odgo
|
||||
power,borod,Hepet,
|
||||
disruption,giseppusiat,Romeshcuhinsk,
|
||||
stalled,balaish,Anuderbi,
|
||||
silicate,domostok,Georgiyev,
|
||||
impossible,ushkalinsky,Helissentam,
|
||||
low,edn,Zuhch,
|
||||
intelligence,inkangbaserta,Midovurasuk,
|
||||
lifeform,fitsawar,Snezhash,
|
||||
common,kosarac,Kalyuc,Eft
|
||||
vy'keen,udyono,Ubimusc,
|
||||
entity,kevich,Vikinoo,Katrogor
|
||||
orbital,kazaniem,Vilskolo,Ayskyv
|
||||
experiment,zohcherdesk,Oriasamynu,
|
||||
past,ayv,Vaye,
|
||||
dead,kolsh,Atc,
|
||||
clarify,ugurusan,Nirogoc,
|
||||
fascinating,leznakoideob,Tuchimaiutsky,
|
||||
atlas,tologri,Imaiu,Abli
|
||||
station,livnye,Yemansk,
|
||||
oxides,tagoda,Prudnye,
|
||||
bless,angels,Unit,
|
||||
interruption,kiyshomanotes,Husovetskiyev,
|
||||
imminently,zaviatnikha,Ervomoste,
|
||||
awakes,trezhir,Krasav,
|
||||
technology,kislobninog,Tegraychiny,
|
||||
yourself,ransiys,Oktyabi,
|
||||
isotope,elburg,Kirenik,
|
||||
overcharges,nouraktichev,Samarimovik,
|
||||
units,truni,Gukoye,
|
||||
language,tuapsemu,Iudachy,
|
||||
brain,ubanov,Hinog,
|
||||
tissue,ibayev,Nemant,
|
||||
research,napatoust,Mobarkad,
|
||||
failure,irnyevs,Yersky,
|
||||
criminal,gotovnoye,Osnodons,Nikurils
|
||||
starships,koyashmaniar,Udinovozyo,Linichik
|
||||
back,hesh,Tov,
|
||||
future,ougleb,Zeyvai,
|
||||
pure,kadn,Esh,
|
||||
sentinel,ugulmato,Peyskyvi,Akovskyv
|
||||
scan,omin,Ibaye,Odubo
|
||||
greed,vezdar,Yurbat,
|
||||
unavailable,ikargoffri,Yobrazdnikolo,
|
||||
motor,aetsk,Iiskiy,
|
||||
fire,utsiv,Hovis,
|
||||
discuss,gansiysk,Alzama,
|
||||
overheat,gobekin,Pogaetsk,
|
||||
contact,gochinoo,Ovdoro,
|
||||
retreat,uriyeve,Sodelik,
|
||||
required,nokamskyv,Osloborzy,
|
||||
alert,zania,Yakuta,
|
||||
core,aso,Osl,
|
||||
artificial,kihopyevetsi,Kinovorogo,
|
||||
insert,puchay,Noriali,
|
||||
bathe,kroymsk,Movsky,
|
||||
or,liz,Som,
|
||||
bad,has,Iud,
|
||||
vessel,skovrov,Niselts,
|
||||
share,bilets,Kutays,
|
||||
topic,glazov,Arossi,
|
||||
reset,nudet,Terga,
|
||||
primary,gester,Bavlek,
|
||||
silicates,miosskaia,Rodnikhimb,
|
||||
excess,epovozm,Helyeli,
|
||||
holy,riki,Tul,
|
||||
respect,zehasha,Nineykhat,
|
||||
excitement,hutarabaltay,Nilokhvin,
|
||||
worship,ladaniv,Rukakov,Asnovsky
|
||||
oxide,uyev,Avet,
|
||||
weaponry,ebskalt,Gudermes,
|
||||
remove,epano,Kanskiy,
|
||||
repair,uvorki,Vigali,
|
||||
resources,lonereche,Lamskyviu,
|
||||
secondary,kelepikiyev,Yemakhdenpo,
|
||||
donate,biysk,Ingra,
|
||||
specialists,dachyegoryk,Blizkimryus,
|
||||
beware,amady,Ipking,
|
||||
destiny,epikiner,Nezhne,
|
||||
escape,izeli,Roreche,
|
||||
eheu,mog,Retsk,
|
||||
existence,somonoslav,Histrogo,
|
||||
examination,kahaylovke,Tutayskommu,
|
||||
ayee,ter,Rubc,
|
||||
apologies,gradnayank,Opolenkur,
|
||||
electron,rameshevs,Osilkul,
|
||||
white,nani,Glazo,
|
||||
loss,akh,Fomi,
|
||||
upload,zoria,Ralskoi,Dreapo
|
||||
ahem,epet,Tous,
|
||||
unknown,ognitog,Metyevka,
|
||||
advance,kopinestv,Gityars,
|
||||
discharge,tovnoslu,Isoglebez,
|
||||
reconstruction,arechnostarii,Futekumskyviump,
|
||||
help,yichie,Skr,
|
||||
gek,akov,Huru,
|
||||
healing,uyevsky,Zulunin,
|
||||
reject,ikungr,Topot,
|
||||
formula,oglegoda,Yukopinog,
|
||||
relevant,yozhensk,Bavlyaqua,
|
||||
allow,ektro,Duly,
|
||||
geological,rimiinakorja,Prudniymita,
|
||||
valuable,ubovkin,Georgiyev,
|
||||
mission,urzhiva,Edelin,
|
||||
begins,emvab,Pikines,
|
||||
ship,pomo,Erchi,
|
||||
becomes,oblasovs,Oboria,
|
||||
filter,tisovsky,Vudinog,
|
||||
leave,monogor,Ortivn,
|
||||
reward,pessk,Evkari,
|
||||
slavery,darnau,Yakovoma,
|
||||
avoid,negors,Vinos,
|
||||
additional,oduboevui,Raktotolya,
|
||||
enthusiast,tivnyevsk,Aymazykaluy,
|
||||
absorb,iudac,Horusang,
|
||||
joyful,hachyeg,Rinush,
|
||||
embrace,deyskyvi,Odemyach,
|
||||
disconnection,ovetsialnyokha,Ayevskovkazh,
|
||||
dislike,zoyormonc,Dorornye,
|
||||
wait,etomu,Kur,
|
||||
disaster,tuyndala,Akinoslo,
|
||||
reboot,gutayga,Zehegu,
|
||||
pain,etamb,Iavl,
|
||||
sleep,kiro,Kubaks,
|
||||
quarantine,yucharabaz,Noozyibkov,
|
||||
detection,zahskyviumv,Manogorone,
|
||||
hole,bogut,Lilero,
|
||||
negotiation,rusakoidammag,Gityabinkang,
|
||||
wakes,aymaz,Nosl,
|
||||
creation,rakinovk,Ozzhevoi,
|
||||
element,zorial,Elgoron,
|
||||
immediately,mezenskyvin,Uapsheboksit,Zadakyuncam
|
||||
loop,yuc,Vano,
|
||||
forbidden,yonkiesbro,Padnayan,
|
||||
soon,meysk,Abins,
|
||||
probable,plimskyv,Grivoshes,
|
||||
control,nozhenyo,Kuznetsi,
|
||||
uncommon,kuvartkal,Nolitama,
|
||||
trade,vigradu,Adsk,
|
||||
signal,iniche,Yungri,
|
||||
hello,evoy,Ariins,
|
||||
blueprint,hovaldanov,Beytishenn,
|
||||
experiments,kasayevkargun,Hinyevskyvi,
|
||||
ending,omlya,Dudino,
|
||||
corrupted,lolashtar,Sutokinom,
|
||||
synthetic,shoyarov,Obekinestu,
|
||||
create,inich,Zeyanse,
|
||||
timeline,ekandal,Teprazdni,
|
||||
poison,dishacha,Nazyv,
|
||||
improbable,yeyskyvium,Imashacher,
|
||||
monolith,reutokaya,Utninsk,
|
||||
youth,livaiu,Kayzyav,
|
||||
galaxy,ondro,Ukrasu,
|
||||
centre,lovan,Zodalnec,
|
||||
reality,godskovo,Tuyrnyevo,
|
||||
speech,vogratsk,Gotoran,
|
||||
casing,tubimu,Holisk,
|
||||
insignificant,iiakhnevichu,Idetskyvinuus,
|
||||
busy,ruiu,For,
|
||||
admires,turazn,Anrogor,
|
||||
friend,yattira,Yatish,
|
||||
permanent,pestneves,Ozzhetsi,
|
||||
speaks,hekovrop,Izans,
|
||||
species,lamsky,Zavolod,
|
||||
benevolence,efremkhonyev,Yarnyaginin,
|
||||
creatures,ichinskyvi,Doukovskyv,
|
||||
isolated,pitkyak,Lamyzihets,
|
||||
attack,bashcaha,Sokopey,
|
||||
researcher,gubkinogors,Ofitsuancu,
|
||||
travels,ezensk,Honyevol,
|
||||
new,oeto,Arus,
|
||||
concentrate,vagraduzhumi,Ozhiyevskyv,
|
||||
operational,uynakoskjar,Usumanzhelya,
|
||||
red,sno,Groz,Vuk
|
||||
neural,ereseng,Sperv,
|
||||
morning,ektrov,Ovostavl,
|
||||
dangerous,yebkovsegem,Doukoyan,
|
||||
good,muchad,Ograt,
|
||||
orb,ray,Kur,
|
||||
technological,ognitskazhevo,Lukulebakaian,Hudogorsmanov
|
||||
darkness,utsialn,Helebska,
|
||||
danger,fitsii,Sudzhi,
|
||||
waters,kitiman,Tensk,
|
||||
temporal,agnitsan,Sukholm,
|
||||
hmm,nik,Naym,
|
||||
level,otdy,Zimeino,
|
||||
praise,arenshec,Sulino,Payevsk
|
||||
child,burgun,Kargo,
|
||||
findings,duiutskaz,Vaskyuvium,
|
||||
file,sosyla,Desno,
|
||||
blob,loyt,Pra,
|
||||
education,inkangbial,Hiliskovsk,
|
||||
automated,oitelebe,Orykohaba,
|
||||
restoration,zuhmandarent,Uppugnatus,
|
||||
your,petu,Yevs,
|
||||
wants,apsh,Erzha,
|
||||
constantly,uapseusius,Hetskaiushn,
|
||||
relearn,tepushc,Ukovsky,
|
||||
transmission,bonyevkazhel,Zainskogoli,
|
||||
network,tulakoid,Sotsky,
|
||||
catalogue,rukhaluymsky,Arganiae,
|
||||
recharge,desnoura,Grozove,
|
||||
decrease,gachyovod,Agodarnau,
|
||||
invisible,ebskaluett,Enburgunca,Madygeys
|
||||
adores,gobekin,Velsk,
|
||||
great,nodalny,Pikako,
|
||||
not,zay,Gac,
|
||||
pay,irz,Illo,
|
||||
ignore,dushc,Roloysva,
|
||||
blockage,irbiturtr,Doygeysk,
|
||||
over,oevus,Voale,
|
||||
better,rubinsky,Sayan,
|
||||
failed,eurazl,Hinach,
|
||||
move,lin,Ogn,
|
||||
traveller's,devoikhoviche,Rafimorsky,
|
||||
goods,sosnoz,Yatk,
|
||||
face,ikov,Tuap,
|
||||
endangered,ryunguryu,Rovodylurus,
|
||||
awaits,oukoyan,Druzha,
|
||||
sales,virsk,Dulia,
|
||||
restore,zadracepa,Daskovopa,
|
||||
information,telnoslanud,Arzamarime,
|
||||
accidentally,onstanasheb,Ulebskabent,
|
||||
federation,hilovkarapu,Eapoluninsk,
|
||||
hazard,esial,Bolesno,
|
||||
save,shichi,Eva,
|
||||
elements,nazyvaye,Vaypolocha,
|
||||
provide,ershovos,Mezens,
|
||||
operator,edynald,Oiteleno,
|
||||
strata,bogonet,Lepiki,
|
||||
join,per,Baychi,
|
||||
remains,kitotor,Payevsk,
|
||||
drone,kesper,Epet,
|
||||
only,yalsko,Ipets,
|
||||
capacitor,veycuhnyev,Kakhnyev,
|
||||
sends,lileys,Demenn,
|
||||
discover,barnyev,Dogotovis,
|
||||
vy'keen,udyono,Ubimusc,
|
||||
feel,iys,Dika,
|
||||
interrupted,iiskiyevsky,Yakhnyevskyv,
|
||||
fault,afimo,Pozzhe,
|
||||
seek,yirnye,Ach,
|
||||
me,vok,Bez,
|
||||
recall,roleemo,Kireng,
|
||||
reciprocal,lashimkin,Yeniiakha,
|
||||
shell,huvisto,Shim,
|
||||
watching,demyonnom,Bolgodoz,
|
||||
welcome,itvaarde,Duvezdare,
|
||||
process,uzlovshi,Giseysky,
|
||||
peace,ulma,Leznav,
|
||||
overpowered,ibiraetsim,Ozlovayevsky,
|
||||
today,enbur,Tilast,
|
||||
vital,inka,Bestno,
|
||||
words,azyvay,Zohyego,
|
||||
away,ums,Donays,
|
||||
average,ervomart,Hernusin,
|
||||
permissions,elnostomuksh,Agiruneate,
|
||||
planetary,bedyniskap,Miyzherep,
|
||||
request,ennits,Yebnoyen,
|
||||
fun,tepr,Liyuy,
|
||||
in,tuni,Mal,
|
||||
circuit,onstara,Poveshe,
|
||||
next,gods,Emer,
|
||||
give,vue,Ners,
|
||||
work,akh,Len,
|
||||
impure,okmin,Adzhevs,
|
||||
question,kandalast,Istrezhy,
|
||||
recorded,olzoves,Tetyusin,
|
||||
entrance,uganrogo,Ivilsky,
|
||||
goodbye,lomayishn,Myzyva,
|
||||
subvert,avliaiut,Meglinogo,
|
||||
production,amyzyvayev,Pallasoves,
|
||||
teach,amcha,Peysahm,
|
||||
dialect,charye,Tayndalm,
|
||||
combine,zunykehady,Yokmin,
|
||||
commendable,uppunicoigno,Biyskiyevkar,
|
||||
command,leyskyv,Sestovs,
|
||||
overseer,hilovskyv,Enshacho,
|
||||
biological,ludatayrnya,Delabulak,
|
||||
stone,yamazyv,Teka,
|
||||
mined,tinsar,Alyn,
|
||||
maximum,iutskyv,Lonyarn,
|
||||
stabilise,poshaets,Tuskuyviumh,
|
||||
sample,gansiys,Gezhach,
|
||||
violence,tushkanau,Oyarskyv,
|
||||
procedure,zelovodst,Engileyn,
|
||||
starship,luymsikyvi,Davliaiu,Mublemyonk
|
||||
electronic,haetsivosh,Fokinosloze,
|
||||
apply,godoi,Piki,
|
||||
discussions,drovskyvinta,Nokurinburgu,
|
||||
touch,ozzhev,Hanyevk,
|
||||
light,niemei,Oitel,
|
||||
here,edin,Emnik,
|
||||
interface,pogaetsiis,Apulaanhu,
|
||||
excellent,aplyoginooz,Losukyvinnu,
|
||||
order,emyo,Bezhn,
|
||||
through,shmanag,Evelinsk,
|
||||
escaped,sozavo,Yuzhasav,
|
||||
studies,gadzhen,Oscowini,
|
||||
feed,oluc,Usmot,
|
||||
follow,namenta,Ginski,
|
||||
initialize,revkaryans,Irenskompl,
|
||||
appropriate,rubcheguta,Okminusinst,
|
||||
with,zenam,Nivat,
|
||||
overload,amyzylsor,Olkovyelki,
|
||||
protection,alumyzyakh,Yoborzyakha,
|
||||
central,torzya,Ubkinosl,
|
||||
atmospheric,yeleznikovk,Onnikaltiys,Spiyskovods
|
||||
remain,erpukh,Tesevozy,
|
||||
drill,ladomo,Resman,
|
||||
know,ady,Opr,
|
||||
terminal,merobayev,Enburgu,
|
||||
success,radnic,Vikovr,
|
||||
behold,lazovay,Vitins,
|
||||
available,ladogdanko,Afimovskyv,
|
||||
facility,yesotska,Ibayevoi,
|
||||
approaches,tetyukhladu,Yishnymitt,
|
||||
cannot,neudint,Luziames,
|
||||
activity,lechatura,Zodokistup,
|
||||
databank,voybrazd,Zihelektr,
|
||||
certain,naulum,Rasnyocta,
|
||||
toxins,olniaet,Yekalt,
|
||||
log,chu,Kem,
|
||||
fabled,evdarg,Konayan,
|
||||
corrosive,chashiesi,Rouralskoi,
|
||||
journey,hidutogq,Kulebsk,Nochin
|
||||
resist,roshary,Fiksyo,
|
||||
tech,neka,Zat,
|
||||
energy,naibol,Meshets,
|
||||
show,rin,Ionov,
|
||||
commences,roshoyarvie,Ovdorona,
|
||||
await,etrop,Ovkara,
|
||||
highly,styugo,Eninsk,Amillov
|
||||
back-up,yinsta,Obskarve,
|
||||
returning,yabysihtagin,Odorodubo,
|
||||
medial,lerov,Katyvik,
|
||||
extracting,myachinskyv,Opyevoyeniz,
|
||||
contraband,rodiashikhv,Zelidovoso,Kihtyomoles
|
||||
shine,nenyk,Ritovn,
|
||||
uploading,imbaykala,Orodskoye,
|
||||
detected,atchinog,Loneralsk,
|
||||
system,odorov,Oginin,
|
||||
unexpected,gulyarnau,Meplimskyvin,
|
||||
expenditure,mirnoznoykha,Shovskyvium,
|
||||
gift,lac,Yabiry,
|
||||
engaged,moletsk,Lukhny,
|
||||
finish,opkin,Turlovk,
|
||||
think,shoya,Zinogo,
|
||||
delivery,pionovk,Dazernoeme,
|
||||
disengaged,zerzhukovok,Yegodstavino,
|
||||
knowledge,vikhopyevo,Noymittac,
|
||||
entities,zuberech,Yanoyeru,
|
||||
this,ibol,Adaky,
|
||||
non-intelligent,sevelskyvinume,Ipatigorbashcuhud,
|
||||
product,beycahnogo,Stvere,
|
||||
contribution,elburgansiysk,Vunymitenemola,
|
||||
tools,eski,Eveto,
|
||||
progress,oglegkorg,Seskaiang,
|
||||
alone,eural,Irovo,
|
||||
use,oul,Dopis,
|
||||
board,bukhoy,Antoyre,
|
||||
at,ilo,Ais,
|
||||
states,lairtzy,Bavlovs,
|
||||
will,push,Sht,
|
||||
all,ukh,Ufi,
|
||||
unlock,trane,Kinskit,
|
||||
of,nii,Slo,
|
||||
for,sut,Lono,
|
||||
and,suma,Mun,
|
||||
choose,eurash,Omarits,
|
||||
are,lak,Rus,
|
||||
to,gep,Mech,
|
||||
on,nok,Erd,
|
||||
you,ludo,Tin,
|
||||
is,ine,Dob,
|
||||
the,olkh,Ene,
|
||||
our,tinan,Rio,
|
||||
stars,ismanz,Kubak,
|
||||
a,ond,Tiso,
|
||||
i,ges,Vod,
|
||||
do,nag,Ort,
|
||||
see,itk,Selt,
|
||||
longrange,isilnyevsk,Yalugani,
|
||||
multitool,uglinooz,Zonikovke,
|
||||
careful,poyatii,Voboya,
|
||||
desk,retyuz,Ipk,
|
||||
we,yuz,Yase,
|
||||
examine,azanski,Eltsovka,
|
||||
using,devoi,Anud,
|
||||
what,bashich,Gradn,
|
||||
alarmed,fitskiti,Kihvald,
|
||||
happening,lagodoij,Tigorskyvi,
|
||||
open,paye,Ond,
|
||||
their,iushki,Yekam,
|
||||
be,yems,Apo,
|
||||
sorry,form,Rabaka,
|
||||
hopes,vomestu,Maiu,
|
||||
divergent,topoluche,Kohrustyugo,
|
||||
material,udutong,Eyskyvi,
|
||||
where,asavi,Litusyn,
|
||||
everywhere,efremiuraza,Koyanskyvin,
|
||||
aiee,leziam,Relya,
|
||||
around,benyev,Imaiu,
|
||||
found,davli,Krem,
|
||||
plants,poshate,Mestno,
|
||||
irrelevance,gotyabinokac,Popavliaiuts,
|
||||
accommodate,egezhgorone,Fimoviatniko,
|
||||
biggest,gutaysh,Tomark,
|
||||
secret,liyarvid,Yungri,
|
||||
design,kuhrom,Iushval,
|
||||
strange,irisogle,Exandy,
|
||||
different,utsiiatni,Nugeleizh,
|
||||
superior,kehtubinsk,Mavinskyv,
|
||||
highest,brasavil,Dobryac,
|
||||
things,zovantu,Holun,
|
||||
effective,panovoku,Imorskyvin,
|
||||
long,syk,Kuyby,
|
||||
suit,amb,Nets,
|
||||
no,bod,Rily,
|
||||
metal,satkar,Ginsk,
|
||||
mortal,luygins,Nanyigyi,
|
||||
unite,anga,Etaru,
|
||||
rampant,barnya,Broneten,
|
||||
comes,ovdor,Merovs,
|
||||
concerned,reapoluchi,Reposskazh,
|
||||
one,lem,Avlo,
|
||||
perhaps,vegorsky,Zolovoyen,
|
||||
expected,hegornoe,Negepasho,
|
||||
asks,liynk,Engoy,
|
||||
am,hum,Gad,
|
||||
lifeforms,rozanykhar,Furmavia,
|
||||
my,mech,Rado,
|
||||
resonance,herkaslibe,Insarypov,
|
||||
report,elgov,Ratilleu,
|
||||
still,sutok,Oblast,
|
||||
it,vir,Zor,
|
||||
holoterminus,sycahnovoyet,Rochyolkovom,
|
||||
from,nil,Eseny,
|
||||
seeing,emansk,Abink,
|
||||
find,otele,Douko,
|
||||
puzzle,timya,Relyel,
|
||||
there,bodarn,Ales,
|
||||
again,myzah,Rukhac,
|
||||
go,gar,Yizy,
|
||||
interesting,vuktyabrasko,Lozhenskiy,
|
||||
been,ubi,Aly,
|
||||
as,yud,Kaha,
|
||||
may,but,Yitn,
|
||||
encounters,rudskoideco,Ivnosokopy,
|
||||
knows,ryanov,Ruka,
|
||||
already,boksitog,Lotnoyet,
|
||||
eleven,voyer,Orskogo,
|
||||
rebirth,usinni,Dachin,
|
||||
compensation,apredovuralsk,Zoriastaixu,
|
||||
video,eyevoz,Torod,
|
||||
private,ezhnyev,Shnymi,
|
||||
discoveries,yermeshkov,Udzhevronako,
|
||||
promised,ubchekans,Nizheguta,
|
||||
minor,akinog,Kine,
|
||||
three,lidovo,Havins,
|
||||
well,ach,Vaybi,
|
||||
polo,amy,Lebu,
|
||||
brings,nodeli,Insarye,
|
||||
did,ubi,Vurov,
|
||||
such,eli,Gep,
|
||||
disconnected,engoyetainicc,Tizaniatnin,
|
||||
earn,nevet,Kezh,
|
||||
must,lore,Gatsi,
|
||||
present,eudint,Ubtsovsk,
|
||||
two,esti,Yung,
|
||||
connection,zovoaltiysk,Boyandrov,
|
||||
hear,mogon,Hus,
|
||||
organic,akanaul,Meinoozy,Tedoykhalya
|
||||
beautiful,ligarimovs,Pavlevigor,
|
||||
sixteen,tebeyt,Akayev,
|
||||
learned,nerogoro,Uguryevs,
|
||||
shall,zeleu,Yonos,
|
||||
us,vob,Biyc,
|
||||
mind,flagi,Elgo,
|
||||
hard,butur,Nicheg,
|
||||
these,zeliz,Yokha,
|
||||
fine,ayg,Oyan,
|
||||
worlds,tunevi,Manikho,
|
||||
generation,amillerob,Nodrovskyvi,
|
||||
requests,hidenpokh,Ichestre,
|
||||
tiny,zer,Mashe,
|
||||
assemble,ilskogae,Kuchigrya,
|
||||
everything,zereslibro,Lermonche,
|
||||
fan,deyk,Iks,
|
||||
four,loyur,Tiny,
|
||||
aids,zadu,Zel,
|
||||
logs,pes,Nasi,
|
||||
yet,yup,Oen,
|
||||
yes,pozz,Dono,
|
||||
they,erc,Zuye,
|
||||
allocated,ryimskyviu,Oustyugora,
|
||||
continue,piyskit,Vezhnosl,
|
||||
moment,torzhig,Piyatsk,
|
||||
fade,dey,Ripin,
|
||||
assist,ziyvayan,Hovsk,
|
||||
saw,olot,Osn,
|
||||
adjust,slyudya,Naymitas,
|
||||
service,gaetsim,Vosteiro,
|
||||
pleasure,rostarsky,Zanskom,
|
||||
upon,usm,Zohsk,
|
||||
faster,yeskoid,Niykhac,
|
||||
trapped,kitimanz,Poluchis,
|
||||
nonexistence,yorskovokhay,Zimanovomari,
|
||||
warping,talnyev,Odnyauza,
|
||||
broadcasts,yesseltsy,Hudozhaian,
|
||||
value,iyevol,Enza,
|
||||
voice,obuzh,Bulans,
|
||||
charging,runinok,Udzhantam,
|
||||
rewarding,renyevoi,Napadnovik,
|
||||
heartbeat,yabrsukyvi,Emovista,
|
||||
disappointing,zavodskommun,Vuyksanovskyvin,
|
||||
score,uver,Yevo,
|
||||
nanites,ugulmato,Layanskiti,
|
||||
most,tana,Yupol,
|
||||
reduced,rilovking,Plastr,
|
||||
succeeds,suselyoshe,Ezovets,
|
||||
warped,ishieme,Rakess,
|
||||
draw,ogu,Yosh,
|
||||
series,sosno,Kezhely,
|
||||
unit,abe,Ekums,
|
||||
enjoy,ekana,Aktot,
|
||||
drama,tobo,Semyon,
|
||||
missions,ebnyevka,Uberben,
|
||||
while,roko,Daniiu,
|
||||
anything,etlogriv,Nadeyshma,
|
||||
both,vukt,Ibo,
|
||||
nada,pev,Haylo,
|
||||
after,vikoel,Govoul,
|
||||
was,tima,Vay,
|
||||
terminate,pudomaysh,Ogrivoikh,
|
||||
task,rac,Sinn,
|
||||
before,iinsky,Bansk,
|
||||
between,ikhardo,Umanovok,
|
||||
truth,atniko,Udets,
|
||||
flesh,ernu,Dost,
|
||||
breached,esyegors,Doymkarpi,
|
||||
harvest,munart,Buinskit,
|
||||
eyes,dika,Zale,
|
||||
disagree,honyevs,Erskyvin,
|
||||
suspicious,soglegkou,Mikhanskyvi,
|
||||
nature,ukovsev,Udyonn,
|
||||
favourites,zarenyovs,Tinskyviu,
|
||||
had,luk,Vic,
|
||||
let,ogn,Puga,
|
||||
origin,bezhna,Megisem,
|
||||
way,dano,Ryokh,
|
||||
suppose,virskovs,Idetelny,
|
||||
real,loymsik,Urz,
|
||||
transfer,medynosba,Yeyskog,
|
||||
enough,mertaur,Urovn,
|
||||
complete,hudenpokro,Naulari,
|
||||
shed,ishcoh,Buko,
|
||||
try,nadz,Hakov,
|
||||
rewards,ruskyuviu,Netsivil,
|
||||
test,brs,Mar,
|
||||
offer,bess,Adimir,
|
||||
an,dud,Zob,
|
||||
why,ubk,Nutey,
|
||||
very,rolo,Pay,
|
||||
attention,azinokamsk,Imechorant,
|
||||
persist,atovor,Virsan,
|
||||
sounds,minyan,Ainstal,
|
||||
forgiven,tadtrund,Asliberal,
|
||||
job,form,Kotic,
|
||||
have,lamy,Yeys,
|
||||
prepared,ukoyenaea,Ripinstav,
|
||||
gate,ugin,Ichi,
|
||||
aid,zeme,Enk,
|
||||
ago,mec,Eto,
|
||||
end,avas,Aoz,
|
||||
universe,raktorab,Etlogor,
|
||||
performing,yuzhasavia,Churilovke,
|
||||
possessions,abrsekyvina,Yubnoyerdis,
|
||||
imagined,lezname,Kanashets,
|
||||
controlled,oguchaylov,Slovantur,
|
||||
portable,odvigatc,Uketyvkaz,
|
||||
keep,etl,Zov,
|
||||
beaten,uitel,Ralner,
|
||||
six,atel,Evro,
|
||||
learn,achi,Zepetu,
|
||||
logged,palla,Yanovo,
|
||||
instantiation,sudzhachitama,Hedurechevskyv,
|
||||
would,mirn,Ayma,
|
||||
build,sumanz,Evsky,
|
||||
distortion,arachyegon,Pogotovia,
|
||||
passes,vomins,Odpork,
|
||||
exocraft,nuguryuka,Yosayando,
|
||||
breach,runinsk,Luykin,
|
||||
its,yon,Lug,
|
||||
doors,fitsia,Deymkar,
|
||||
each,ray,Menog,
|
||||
reestablish,ryinstevovo,Enyevkarosl,
|
||||
look,yuch,Vet,
|
||||
abyss,limyzya,Sensh,
|
||||
congratulations,ozmodemerouglego,Ibolskovorkhot,
|
||||
now,luy,Maiu,
|
||||
waited,teryu,Lilets,
|
||||
beckons,gepast,Etomut,
|
||||
nothing,nerogobe,Zedokis,
|
||||
looks,tiam,Siysk,
|
||||
skilled,bezhdo,Deneudin,
|
||||
costume,kuyshest,Omariins,
|
||||
message,rabanov,Izilyu,
|
||||
water,aktotm,Udutog,
|
||||
about,eksin,Enpoka,
|
||||
largest,modeys,Anninok,
|
||||
visible,akzhets,Avolovsk,
|
||||
wrong,furm,Sasovo,
|
||||
life,liny,Keme,
|
||||
package,viremovse,Zimeinog,
|
||||
statistics,vorogorodia,Tanovnosti,
|
||||
enter,esoz,Hodin,
|
||||
so,hola,Yul,
|
||||
absence,ommuna,Illovoy,
|
||||
like,hilku,Nudal,
|
||||
but,ads,Zehn,
|
||||
anomaly,nuyovsh,Odinov,
|
||||
pleased,tionoslu,Plimors,
|
||||
warn,siselb,Mos,
|
||||
smiles,itkyart,Nesaraya,
|
||||
other,evdar,Ranoet,
|
||||
victory,kazhdogo,Nikakhal,
|
||||
percent,zensky,Lokhoy,
|
||||
start,algo,Dubn,
|
||||
settle,novsky,Sushc,
|
||||
has,nur,Laga,
|
||||
stronger,hatsialn,Verkess,
|
||||
closer,hutins,Nosohchev,
|
||||
earning,rimontoro,Inacheny,
|
||||
carapace,dazhevsko,Islozhosk,
|
||||
warp,tovsh,Zabak,
|
||||
twelve,dudino,Yukalyn,
|
||||
check,rozo,Sivirs,
|
||||
immediate,edinkarsal,Aplyovos,
|
||||
world,evdar,Aplyov,
|
||||
transmitter,unguruslaval,Puysohkinoozyb,
|
||||
once,mak,Usla,
|
||||
more,arii,Mich,
|
||||
five,nisiy,Hen,
|
||||
projection,amskyvium,Brazmanga,
|
||||
analysis,uboevushc,Imenskyvi,
|
||||
even,onno,Teyn,
|
||||
business,kusanqab,Zekimovis,
|
||||
them,loyar,Rorek,
|
||||
best,odvi,Kotr,
|
||||
notes,mari,Amura,
|
||||
communion,gulkevino,Ryluskyvin,
|
||||
how,ezn,Gop,
|
||||
ten,mest,Zaba,
|
||||
containment,iyevskyvin,Udozhelyeaex,
|
||||
purify,ransi,Voikhay,
|
||||
take,zilyu,Ogni,
|
||||
much,anko,Mash,
|
||||
answer,havinsk,Alugan,
|
||||
unpleasing,unechovori,Ozeleuzen,
|
||||
say,zuyor,Otla,
|
||||
ancestor,emanzheg,Eynoyet,
|
||||
sees,gar,Rishc,
|
||||
pattern,ogutay,Yushnyev,
|
||||
emergency,eapoluch,Alinichel,
|
||||
|
254
lang.go
254
lang.go
@@ -9,119 +9,183 @@ import (
|
||||
)
|
||||
|
||||
/*
|
||||
Korvaxlang - set up structure of a word iteration
|
||||
Translate words
|
||||
*/
|
||||
type Korvaxlang struct {
|
||||
English string
|
||||
KorvaxWord string
|
||||
KWCaps string
|
||||
KWALLCAPS string
|
||||
type Translate struct {
|
||||
word string
|
||||
}
|
||||
|
||||
// trans - set up structure of a word iteration
|
||||
type trans0 struct {
|
||||
english string // english word
|
||||
word string // no caps word
|
||||
capword string // Capitalized word
|
||||
acpword string // ALL CAPITALIZED WORD
|
||||
}
|
||||
|
||||
/*
|
||||
Korvax2Eng - convert known korvax words into english
|
||||
Kor2Eng translate korvax word to english word
|
||||
*/
|
||||
func Korvax2Eng(kvwrd string) string {
|
||||
data, err := Asset("tmp.nmslib/korvax-lang.csv")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
func (t Translate) Kor2Eng() (returnstring string) {
|
||||
csvlines := openCSV("korvax-lang.csv")
|
||||
for range csvlines {
|
||||
returnstring = (toEng(t, csvlines))
|
||||
}
|
||||
_, err2 := os.Stat("tmp.nmslib/")
|
||||
if os.IsNotExist(err2) {
|
||||
errDir := os.MkdirAll("tmp.nmslib/", 0755)
|
||||
if errDir != nil {
|
||||
panic(errDir)
|
||||
}
|
||||
}
|
||||
err = ioutil.WriteFile("tmp.nmslib/korvax-lang.csv", []byte(data), 0644)
|
||||
csvFile, err := os.Open("tmp.nmslib/korvax-lang.csv")
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
defer csvFile.Close()
|
||||
CsvLines, err := csv.NewReader(csvFile).ReadAll()
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
for _, line := range CsvLines {
|
||||
klang := Korvaxlang{
|
||||
English: line[0],
|
||||
KorvaxWord: line[1],
|
||||
KWCaps: line[2],
|
||||
KWALLCAPS: line[3],
|
||||
}
|
||||
if kvwrd == klang.KorvaxWord {
|
||||
errDir := os.RemoveAll("tmp.nmslib")
|
||||
if errDir != nil {
|
||||
panic(errDir)
|
||||
}
|
||||
return klang.English
|
||||
} else if kvwrd == klang.KWCaps {
|
||||
errDir := os.RemoveAll("tmp.nmslib")
|
||||
if errDir != nil {
|
||||
panic(errDir)
|
||||
}
|
||||
return strings.Title(strings.ToLower(klang.English))
|
||||
} else if kvwrd == klang.KWALLCAPS {
|
||||
errDir := os.RemoveAll("tmp.nmslib")
|
||||
if errDir != nil {
|
||||
panic(errDir)
|
||||
}
|
||||
return strings.ToUpper(klang.English)
|
||||
}
|
||||
}
|
||||
// remove recource folder to keep it clean
|
||||
errDir := os.RemoveAll("tmp.nmslib")
|
||||
if errDir != nil {
|
||||
panic(errDir)
|
||||
}
|
||||
return "*\\Kzzzzzzt\\*" // word not found default
|
||||
return
|
||||
}
|
||||
|
||||
/*
|
||||
Eng2Korvax - Convert (some) english words to Korvax
|
||||
Eng2Kor translate english word to korvax word
|
||||
*/
|
||||
func Eng2Korvax(enwrd string) string {
|
||||
data, err := Asset("tmp.nmslib/korvax-lang.csv")
|
||||
func (t Translate) Eng2Kor() (returnstring string) {
|
||||
csvlines := openCSV("korvax-lang.csv")
|
||||
for range csvlines {
|
||||
returnstring = (toNMS(t, csvlines))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
/*
|
||||
Gek2Eng translate Gek word to english word
|
||||
*/
|
||||
func (t Translate) Gek2Eng() (returnstring string) {
|
||||
csvlines := openCSV("gek-lang.csv")
|
||||
for range csvlines {
|
||||
returnstring = (toEng(t, csvlines))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
/*
|
||||
Eng2Gek translate english word to Gek word
|
||||
*/
|
||||
func (t Translate) Eng2Gek() (returnstring string) {
|
||||
csvlines := openCSV("gek-lang.csv")
|
||||
for range csvlines {
|
||||
returnstring = (toNMS(t, csvlines))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
/*
|
||||
Vyk2Eng translate vykeen word to english word
|
||||
*/
|
||||
func (t Translate) Vyk2Eng() (returnstring string) {
|
||||
csvlines := openCSV("vykeen-lang.csv")
|
||||
for range csvlines {
|
||||
returnstring = (toEng(t, csvlines))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
/*
|
||||
Eng2Vyk translate english word to vykeen word
|
||||
*/
|
||||
func (t Translate) Eng2Vyk() (returnstring string) {
|
||||
csvlines := openCSV("vykeen-lang.csv")
|
||||
for range csvlines {
|
||||
returnstring = (toNMS(t, csvlines))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
/*
|
||||
Atl2Eng translate Atlas word to english word
|
||||
*/
|
||||
func (t Translate) Atl2Eng() (returnstring string) {
|
||||
csvlines := openCSV("atlas-lang.csv")
|
||||
for range csvlines {
|
||||
returnstring = (toEng(t, csvlines))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
/*
|
||||
Eng2Atl translate english word to Atlas word
|
||||
*/
|
||||
func (t Translate) Eng2Atl() (returnstring string) {
|
||||
csvlines := openCSV("atlas-lang.csv")
|
||||
for range csvlines {
|
||||
returnstring = (toNMS(t, csvlines))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func toEng(t Translate, csvlines [][]string) string {
|
||||
returnstring := "*\\Kzzzzzzt\\*" // word not found default
|
||||
for _, line := range csvlines {
|
||||
lang := trans0{
|
||||
english: strings.ToLower(line[0]),
|
||||
word: strings.ToLower(line[1]),
|
||||
capword: strings.ToLower(line[2]),
|
||||
acpword: strings.ToLower(line[3]),
|
||||
}
|
||||
// check translate struct for value
|
||||
if strings.ToLower(t.word) == lang.word {
|
||||
returnstring = lang.english
|
||||
} else if strings.ToLower(t.word) == lang.capword {
|
||||
returnstring = strings.Title(strings.ToLower(lang.english))
|
||||
} else if strings.ToLower(t.word) == lang.acpword {
|
||||
returnstring = strings.ToUpper(lang.english)
|
||||
}
|
||||
}
|
||||
return returnstring
|
||||
}
|
||||
|
||||
func toNMS(t Translate, csvlines [][]string) string {
|
||||
returnstring := "*\\Kzzzzzzt\\*" // word not found default
|
||||
for _, line := range csvlines {
|
||||
lang := trans0{
|
||||
english: line[0],
|
||||
word: line[1],
|
||||
capword: line[2],
|
||||
acpword: line[3],
|
||||
}
|
||||
if t.word == lang.english {
|
||||
if lang.word != "" {
|
||||
returnstring = lang.word
|
||||
}
|
||||
}
|
||||
if t.word == strings.Title(strings.ToLower(lang.english)) {
|
||||
if lang.capword != "" {
|
||||
returnstring = strings.Title(strings.ToLower(lang.capword))
|
||||
}
|
||||
}
|
||||
if t.word == strings.ToUpper(lang.english) {
|
||||
if lang.acpword != "" {
|
||||
returnstring = strings.ToUpper(lang.acpword)
|
||||
}
|
||||
}
|
||||
}
|
||||
return returnstring
|
||||
}
|
||||
|
||||
func openCSV(lagcsv string) [][]string {
|
||||
// create temp dir
|
||||
tempdir, err := ioutil.TempDir("", "nmslib-")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
_, err2 := os.Stat("tmp.nmslib/")
|
||||
if os.IsNotExist(err2) {
|
||||
errDir := os.MkdirAll("tmp.nmslib/", 0755)
|
||||
if errDir != nil {
|
||||
panic(errDir)
|
||||
}
|
||||
defer os.RemoveAll(tempdir) // Clean up temp files
|
||||
|
||||
// extract language file from resources.go
|
||||
data, err := Asset(lagcsv)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
err = ioutil.WriteFile("tmp.nmslib/korvax-lang.csv", []byte(data), 0644)
|
||||
csvFile, err := os.Open("tmp.nmslib/korvax-lang.csv")
|
||||
|
||||
// wirte extracted data to temp dir
|
||||
err = ioutil.WriteFile(tempdir+"/"+lagcsv, []byte(data), 0644)
|
||||
csvFile, err := os.Open(tempdir + "/" + lagcsv)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
defer csvFile.Close()
|
||||
CsvLines, err := csv.NewReader(csvFile).ReadAll()
|
||||
defer csvFile.Close() // close language file when finished
|
||||
|
||||
// read csv file from memory
|
||||
csvlines, err := csv.NewReader(csvFile).ReadAll()
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
for _, line := range CsvLines {
|
||||
klang := Korvaxlang{
|
||||
English: line[0],
|
||||
KorvaxWord: line[1],
|
||||
KWCaps: line[2],
|
||||
KWALLCAPS: line[3],
|
||||
}
|
||||
if enwrd == klang.English {
|
||||
errDir := os.RemoveAll("tmp.nmslib")
|
||||
if errDir != nil {
|
||||
panic(errDir)
|
||||
}
|
||||
return klang.KorvaxWord
|
||||
}
|
||||
}
|
||||
// remove recource folder to keep it clean
|
||||
errDir := os.RemoveAll("tmp.nmslib")
|
||||
if errDir != nil {
|
||||
panic(errDir)
|
||||
}
|
||||
return "*\\Kzzzzzzt\\*" // word not found default
|
||||
return csvlines
|
||||
}
|
||||
|
||||
@@ -15,64 +15,70 @@ func TestPortal2Galactic(t *testing.T) {
|
||||
} else {
|
||||
fmt.Printf("Testing P2gc(\"006afa556c30\"): got: %q, want: %q.\n", want, "042F:0079:0D55:006A")
|
||||
}
|
||||
|
||||
want, err = P2gc("41EDF9554C2F")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if want != "042E:0078:0D53:01ED" {
|
||||
t.Errorf("Testing P2gc(\"41EDF9554C2F\"): got %q, want: %q.\n", want, "042E:0078:0D53:01ED")
|
||||
} else {
|
||||
fmt.Printf("Testing P2gc(\"41EDF9554C2F\"): got: %q, want: %q.\n", want, "042E:0078:0D53:01ED")
|
||||
}
|
||||
}
|
||||
|
||||
func TestGalactic2portal(t *testing.T) {
|
||||
want, err := Gc2p("042F:0079:0D55:006A")
|
||||
want, err := Gc2p("042F:0079:0D55:006A", 1)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if want != "106AFA556C30" {
|
||||
t.Errorf("Testing Gc2p(\"042F:0079:0D55:006A\"): got %q, want: %q.\n", want, "106AFA556C30")
|
||||
t.Errorf("\nTesting Gc2p(\"042F:0079:0D55:006A\"): got %q, want: %q.\n", want, "106AFA556C30")
|
||||
} else {
|
||||
fmt.Printf("Testing Gc2p(\"042F:0079:0D55:006A\"): got: %q, want: %q.\n", want, "106AFA556C30")
|
||||
fmt.Printf("\nTesting Gc2p(\"042F:0079:0D55:006A\"): got: %q, want: %q.\n", want, "106AFA556C30")
|
||||
}
|
||||
|
||||
want, err = Gc2p("044B:0081:0D68:0096")
|
||||
want, err = Gc2p("042E:0078:0D53:01ED", 4)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if want != "109602569C4C" {
|
||||
t.Errorf("Testing Gc2p(\"044B:0081:0D68:0096\"): got %q, want: %q.\n", want, "109602569C4C")
|
||||
if want != "41EDF9554C2F" {
|
||||
t.Errorf("Testing Gc2p(\"042E:0078:0D53:01ED\"): got %q, want: %q.\n", want, "41EDF9554C2F")
|
||||
} else {
|
||||
fmt.Printf("Testing Gc2p(\"044B:0081:0D68:0096\"): got: %q, want: %q.\n", want, "109602569C4C")
|
||||
fmt.Printf("Testing Gc2p(\"042E:0078:0D53:01ED\"): got: %q, want: %q.\n", want, "41EDF9554C2F")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCreateBanner(t *testing.T) {
|
||||
fmt.Printf("Testing CreateBanner: ")
|
||||
fmt.Printf("\nTesting CreateBanner: ")
|
||||
CreateBanner("006afa556c30", "/tmp/Test.png", 0)
|
||||
}
|
||||
|
||||
func TestKorvax2Eng(t *testing.T) {
|
||||
want := Korvax2Eng("eapoluch")
|
||||
if want != "emergency" {
|
||||
t.Errorf("Testing Korvax2eng(\"eapoluch\"): got %q, want: %q.\n", want, "emergency")
|
||||
func TestTranslate(t *testing.T) {
|
||||
want := Translate{"Paka"}
|
||||
if want.Atl2Eng() != "Awake" {
|
||||
t.Errorf("\nTesting Translate{\"Paka\"}.Atl2Eng(): got %q, want: %q.\n", want.Atl2Eng(), "Awake")
|
||||
} else {
|
||||
fmt.Printf("Testing Korvax2eng(\"eapoluch\"): got %q, want: %q.\n", want, "emergency")
|
||||
fmt.Printf("\nTesting Translate{\"Paka\"}.Atl2Eng(): got %q, want: %q.\n", want.Atl2Eng(), "Awake")
|
||||
}
|
||||
want = Translate{"hofsos"}
|
||||
if want.Gek2Eng() != "answer" {
|
||||
t.Errorf("Testing Translate{\"hofsos\"}.Gek2Eng(): got %q, want: %q.\n", want.Gek2Eng(), "answer")
|
||||
} else {
|
||||
fmt.Printf("Testing Translate{\"hofsos\"}.Gek2Eng(): got %q, want: %q.\n", want.Gek2Eng(), "answer")
|
||||
}
|
||||
|
||||
want = Korvax2Eng("notaword")
|
||||
if want != "*\\Kzzzzzzt\\*" {
|
||||
t.Errorf("Testing Korvax2eng(\"notaword\"): got %q, want: %q.\n", want, "*\\Kzzzzzzt\\*")
|
||||
want = Translate{"Aqo"}
|
||||
if want.Vyk2Eng() != "Foes" {
|
||||
t.Errorf("Testing Translate{\"Aqo\"}.Vyk2Eng(): got %q, want: %q.\n", want.Vyk2Eng(), "Foes")
|
||||
} else {
|
||||
fmt.Printf("Testing Korvax2eng(\"notaword\"): got %q, want: %q.\n", want, "*\\Kzzzzzzt\\*")
|
||||
fmt.Printf("Testing Translate{\"Aqo\"}.Vyk2Eng(): got %q, want: %q.\n", want.Vyk2Eng(), "Foes")
|
||||
}
|
||||
}
|
||||
|
||||
func TestEng2Korvax(t *testing.T) {
|
||||
want := Eng2Korvax("emergency")
|
||||
if want != "eapoluch" {
|
||||
t.Errorf("Testing Eng2Korvax(\"emergency\"): got %q, want: %q.\n", want, "eapoluch")
|
||||
} else {
|
||||
fmt.Printf("Testing Eng2Korvax(\"emergency\"): got %q, want: %q.\n", want, "eapoluch")
|
||||
}
|
||||
|
||||
want = Eng2Korvax("notaword")
|
||||
if want != "*\\Kzzzzzzt\\*" {
|
||||
t.Errorf("Testing Eng2Korvax(\"notaword\"): got %q, want: %q.\n", want, "*\\Kzzzzzzt\\*")
|
||||
} else {
|
||||
fmt.Printf("Testing Eng2Korvax(\"notaword\"): got %q, want: %q.\n", want, "*\\Kzzzzzzt\\*")
|
||||
}
|
||||
fmt.Printf("Testing: ")
|
||||
want = Translate{"Alinichel"}
|
||||
if want.Kor2Eng() != "Emergency" {
|
||||
t.Errorf("Testing Translate{\"Alinichel\"}.Kor2Eng(): got %q, want: %q.\n", want.Kor2Eng(), "Emergency")
|
||||
} else {
|
||||
fmt.Printf("Testing Translate{\"Alinichel\"}.Kor2Eng(): got %q, want: %q.\n", want.Kor2Eng(), "Emergency")
|
||||
}
|
||||
fmt.Printf("\nTesting complete.\nStatus: ")
|
||||
}
|
||||
|
||||
413
resources.go
413
resources.go
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user