from avalanche import i_stem
import json


arabs = [
{"word":"admiral", "stem":"admir"},
{"word":"adobe", "stem":"adob"},
{"word":"afrit", "stem":"afrit"},
{"word":"albatross", "stem":"albatross"},
{"word":"alchemy", "stem":"alchem"},
{"word":"alcohol", "stem":"alcohol"},
{"word":"alcove", "stem":"alcov"},
{"word":"alembic", "stem":"alemb"},
{"word":"alfalfa", "stem":"alfal"},
{"word":"algebra", "stem":"algebr"},
{"word":"algorism", "stem":"algor"},
{"word":"algorithm", "stem":"algorith"},
{"word":"alidade", "stem":"alidad"},
{"word":"alizarin", "stem":"alizar"},
{"word":"alkali", "stem":"alkal"},
{"word":"alkanet", "stem":"alkanet"},
{"word":"alkannin", "stem":"alkann"},
{"word":"almanac", "stem":"alman"},
{"word":"amalgam", "stem":"amalg"},
{"word":"amber", "stem":"amber"},
{"word":"ambergris", "stem":"amberg"},
{"word":"aniline", "stem":"anil"},
{"word":"antimony", "stem":"antimon"},
{"word":"apricot", "stem":"apricot"},
{"word":"arsenal", "stem":"arsen"},
{"word":"artichoke", "stem":"artichok"},
{"word":"assassin", "stem":"assass"},
{"word":"attar", "stem":"attar"},
{"word":"aubergine", "stem":"auberg"},
{"word":"average", "stem":"averag"},
{"word":"azimuth", "stem":"azimuth"},
{"word":"azure", "stem":"azur"},
{"word":"azurite", "stem":"azurit"},
{"word":"benzene", "stem":"benz"},
{"word":"bezoar", "stem":"bezoar"},
{"word":"borage", "stem":"borag"},
{"word":"borate", "stem":"borat"},
{"word":"borax", "stem":"borax"},
{"word":"boron", "stem":"boron"},
{"word":"cafe", "stem":"cafe"},
{"word":"caliber", "stem":"calib"},
{"word":"calipers", "stem":"calip"},
{"word":"camphor", "stem":"camp"},
{"word":"candy", "stem":"cand"},
{"word":"carafe", "stem":"cara"},
{"word":"carat", "stem":"carat"},
{"word":"caravan", "stem":"caravan"},
{"word":"caraway", "stem":"caraway"},
{"word":"carob", "stem":"carob"},
{"word":"carrack", "stem":"carrack"},
{"word":"check", "stem":"check"},
{"word":"chemistry", "stem":"chem"},
{"word":"cheque", "stem":"cheq"},
{"word":"chess", "stem":"chess"},
{"word":"cipher", "stem":"cipher"},
{"word":"civet", "stem":"civet"},
{"word":"coffee", "stem":"coff"},
{"word":"cork", "stem":"cork"},
{"word":"cotton", "stem":"cotton"},
{"word":"crimson", "stem":"crimson"},
{"word":"curcuma", "stem":"curcum"},
{"word":"damask", "stem":"damask"},
{"word":"decipher", "stem":"deciph"},
{"word":"demitasse", "stem":"demitass"},
{"word":"drub", "stem":"drub"},
{"word":"elixir", "stem":"elixir"},
{"word":"erg", "stem":"erg"},
{"word":"exchequer", "stem":"excheq"},
{"word":"fanfare", "stem":"fanfar"},
{"word":"fennec", "stem":"fennec"},
{"word":"garbage", "stem":"garbag"},
{"word":"garble", "stem":"garbl"},
{"word":"gauze", "stem":"gauz"},
{"word":"gazelle", "stem":"gazel"},
{"word":"genet", "stem":"genet"},
{"word":"gerbil", "stem":"gerbil"},
{"word":"ghoul", "stem":"ghoul"},
{"word":"giraffe", "stem":"gira"},
{"word":"guitar", "stem":"guitar"},
{"word":"gundi", "stem":"gun"},
{"word":"haboob", "stem":"haboob"},
{"word":"hamada", "stem":"hamad"},
{"word":"harem", "stem":"harem"},
{"word":"hashish", "stem":"hashish"},
{"word":"hazard", "stem":"hazard"},
{"word":"henna", "stem":"henn"},
{"word":"hookah", "stem":"hookah"},
{"word":"hummus", "stem":"hummus"},
{"word":"jar", "stem":"jar"},
{"word":"jasmine", "stem":"jasm"},
{"word":"jerboa", "stem":"jerb"},
{"word":"jessamine", "stem":"jessam"},
{"word":"jinn", "stem":"jinn"},
{"word":"jird", "stem":"jird"},
{"word":"julep", "stem":"julep"},
{"word":"jumper", "stem":"jumper"},
{"word":"kalium", "stem":"kalium"},
{"word":"lazulite", "stem":"lazu"},
{"word":"nadir", "stem":"nadir"},
{"word":"natrium", "stem":"natr"},
{"word":"natron", "stem":"natron"},
{"word":"orange", "stem":"orang"},
{"word":"popinjay", "stem":"popinjay"},
{"word":"racket", "stem":"racket"},
{"word":"realgar", "stem":"real"},
{"word":"ream", "stem":"ream"},
{"word":"roc", "stem":"roc"},
{"word":"rook", "stem":"rook"},
{"word":"sabkha", "stem":"sabkh"},
{"word":"safari", "stem":"safar"},
{"word":"saffron", "stem":"saff"},
{"word":"saphena", "stem":"saphen"},
{"word":"sash", "stem":"sash"},
{"word":"scarlet", "stem":"scarlet"},
{"word":"sequin", "stem":"sequin"},
{"word":"serendipity", "stem":"serendip"},
{"word":"sheikh", "stem":"sheikh"},
{"word":"sherbet", "stem":"sherbet"},
{"word":"soda", "stem":"soda"},
{"word":"sodium", "stem":"sodium"},
{"word":"sofa", "stem":"sofa"},
{"word":"sorbet", "stem":"sorbet"},
{"word":"spinach", "stem":"spinach"},
{"word":"sucrose", "stem":"sucr"},
{"word":"sugar", "stem":"sugar"},
{"word":"sultan", "stem":"sultan"},
{"word":"sumac", "stem":"sumac"},
{"word":"swahili", "stem":"swahil"},
{"word":"syrup", "stem":"syrup"},
{"word":"tabla", "stem":"tabl"},
{"word":"tahini", "stem":"tahin"},
{"word":"talc", "stem":"talc"},
{"word":"talisman", "stem":"talism"},
{"word":"tamarind", "stem":"tamarind"},
{"word":"tambouras", "stem":"tamb"},
{"word":"tanbur", "stem":"tanbur"},
{"word":"tangerine", "stem":"tanger"},
{"word":"tare", "stem":"tare"},
{"word":"tariff", "stem":"tari"},
{"word":"tarragon", "stem":"tarrag"},
{"word":"tartar", "stem":"tartar"},
{"word":"tartrate", "stem":"tartr"},
{"word":"tazza", "stem":"tazz"},
{"word":"tobacco", "stem":"tobacc"},
{"word":"traffic", "stem":"traf"},
{"word":"tuna", "stem":"tuna"},
{"word":"varanus", "stem":"varan"},
{"word":"vizier", "stem":"vizier"},
{"word":"wadi", "stem":"wadi"},
{"word":"zenith", "stem":"zenith"},
{"word":"zero", "stem":"zero"},
{"word":"zircon", "stem":"zircon"},
]

arabs_stem = [
"admir",
"adob",
"afrit",
"albatross",
"alchem",
"alcohol",
"alcov",
"alemb",
"alfal",
"algebr",
"algor",
"algorith",
"alidad",
"alizar",
"alkal",
"alkanet",
"alkann",
"alman",
"amalg",
"amber",
"amberg",
"anil",
"antimon",
"apricot",
"arsen",
"artichok",
"assass",
"attar",
"auberg",
"averag",
"azimuth",
"azur",
"azurit",
"benz",
"bezoar",
"borag",
"borat",
"borax",
"boron",
"cafe",
"calib",
"calip",
"camp",
"cand",
"cara",
"carat",
"caravan",
"caraway",
"carob",
"carrack",
"check",
"chem",
"cheq",
"chess",
"cipher",
"civet",
"coff",
"cork",
"cotton",
"crimson",
"curcum",
"damask",
"deciph",
"demitass",
"drub",
"elixir",
"erg",
"excheq",
"fanfar",
"fennec",
"garbag",
"garbl",
"gauz",
"gazel",
"genet",
"gerbil",
"ghoul",
"gira",
"guitar",
"gun",
"haboob",
"hamad",
"harem",
"hashish",
"hazard",
"henn",
"hookah",
"hummus",
"jar",
"jasm",
"jerb",
"jessam",
"jinn",
"jird",
"julep",
"jumper",
"kalium",
"lazu",
"nadir",
"natr",
"natron",
"orang",
"popinjay",
"racket",
"real",
"ream",
"roc",
"rook",
"sabkh",
"safar",
"saff",
"saphen",
"sash",
"scarlet",
"sequin",
"serendip",
"sheikh",
"sherbet",
"soda",
"sodium",
"sofa",
"sorbet",
"spinach",
"sucr",
"sugar",
"sultan",
"sumac",
"swahil",
"syrup",
"tabl",
"tahin",
"talc",
"talism",
"tamarind",
"tamb",
"tanbur",
"tanger",
"tare",
"tari",
"tarrag",
"tartar",
"tartr",
"tazz",
"tobacc",
"traf",
"tuna",
"varan",
"vizier",
"wadi",
"zenith",
"zero",
"zircon",
]

stems = json.load(
    open('../../corpus-roamer/src/assets/word_stems_zh.json', 'r', encoding='utf8'))

# # with open('./wow_vocab', 'r') as f:
# for w in arabs:
  # w = w['word']
  # stem = i_stem(w, True)
  # print(f'{{"word":"{w}", "stem":"{stem}"}},')


for st in stems:
  if st in arabs_stem:
    print (arabs[arabs_stem.index(st)])