RedDetectorDev / RedDetector

紅色背景偵測器 喺一個幫你喺上緊網嘅時候,自動辨認紅色背景嘅公司、牌子、字句等等嘅 browser extension
17 stars 3 forks source link

JSON Format #4

Open LaHKPoliceNe opened 6 years ago

LaHKPoliceNe commented 6 years ago

我諗到以下嘅 json format 既可以方便人睇, 又可以睇到有冇漏咗中文或者英文 (其實同之前連登講嘅差唔多) 希望你啱使啦 { "Type1": { "Key1": { "hk":["中文名1", "中文名2"], "en":["English Name 1", "English Name 2"] }, "Key2": { "hk":[], "en":["English Name"] }, "Key3": { "hk":["中文名"], "en":[] } }, "Type2": { "Key4": { "hk":["中文名1", "中文名2"], "en":["English Name 1", "English Name 2"] }, "Key5": { "hk":[], "en":["English Name"] }, "Key6": { "hk":["中文名"], "en":[] } } }

Type 同 key 都係俾人眼睇嘅 而 hk 同 en 入面嘅 array list 先係真正俾 program 拎嚟 check

因為要分返開中文同英文兩條list 咁你要 read個json嘅時候加多個function 大約係咁:

hkList = [];
enList = [];
listJson = JSON.parse(list);

for (var type in listJson) {
    typeJson = listJson[type];
    for (var key in typeJson) {
        hkList = hkList.concat(typeJson[key]['hk']);
        enList = enList.concat(typeJson[key]['en']);
    }
}

console.log(hkList);
console.log(enList);
LaHKPoliceNe commented 6 years ago

json都砌好咗 搞咗半日, 屌, 香港真係好撚多支那公司 呢個list係 [Added 比亞迪(BYD), 金龍(Kinglong), 福田(Foton), 廣汽, 江淮(JAC),東風(DongFeng), 華晨…] 之後最新嗰條list砌出嚟嘅 希望啲type啱

{
    "大集團/銀行/金融": {
        "三九集團": { "hk":["三九集團"], "en":[] }, 
        "中信集團": { "hk":["中信集團"], "en":[] }, 
        "華潤": { "hk":["華潤", "利原"], "en":[] }, 
        "阿里巴巴": { "hk":["阿里巴巴"], "en":[] }, 
        "騰訊": { "hk":["騰訊"], "en":["Tencent"] }, 
        "亞美大陸煤層氣": { "hk":["亞美大陸煤層氣"], "en":[] }, 
        "凱雷": { "hk":["凱雷"], "en":[] }, 
        "通用電氣": { "hk":["通用電氣"], "en":[] }, 
        "中銀": { "hk":["中國銀行", "中銀"], "en":[] }, 
        "國信證券": { "hk":["國信證券"], "en":[] }, 
        "招商局": { "hk":["招商局"], "en":[] }, 
        "耀才證券": { "hk":["耀才證券"], "en":["Bright Smart Securities"] }, 
        "香港人壽": { "hk":["香港人壽"], "en":["Hong Kong Life Insurance"] }, 
        "中國人壽": { "hk":["中國人壽"], "en":["China Life Insurance"] }, 
        "中國平安": { "hk":["中國平安"], "en":["Ping An Insurance"] }
    }, 

    "建築/地產/工業": {
        "中國建築": { "hk":["中國建築"], "en":["China State Construction"] }, 
        "中港混凝土": { "hk":["中港混凝土"], "en":[] }, 
        "僑商置業": { "hk":["僑商置業"], "en":[] }, 
        "晉安實業": { "hk":["晉安實業"], "en":["Thing On Enterprise"] }, 
        "大同機械": { "hk":["大同機械"], "en":[] }
    }, 

    "傳媒": {
        "央視": { "hk":["中央電視台", "央視"], "en":[] }, 
        "TVB": { "hk":["無綫電視", "無線電視"], "en":["TVB"] }, 
        "樂視": { "hk":["樂視"], "en":["LeEco"] }, 
        "香港01": { "hk":["香港01", "01博評", "01哲學", "01觀點"], "en":["HK01"] },     
        "文匯報": { "hk":["文匯報"], "en":[] }, 
        "大公報": { "hk":["大公報"], "en":[] }, 
        "星島日報": { "hk":["星島日報"], "en":[] }, 
        "東方日報": { "hk":["東方日報"], "en":[] }, 
        "太陽報": { "hk":["太陽報"], "en":[] }, 
        "商報": { "hk":["商報"], "en":[] }, 
        "晴報": { "hk":["晴報"], "en":[] }, 
        "頭條日報": { "hk":["頭條日報"], "en":[] }, 
        "成報": { "hk":["成報"], "en":[] }, 
        "新報": { "hk":["新報"], "en":[] }, 
        "南周": { "hk":["南周", "南方周末"], "en":[] }, 
        "英文虎報": { "hk":["英文虎報"], "en":[] }, 
        "橙新聞": { "hk":["橙新聞"], "en":["Orange News"] }, 
        "線報": { "hk":["線報"], "en":["LinePost"] }, 
        "HKG報": { "hk":["HKG報"], "en":[] }, 
        "港人講地": { "hk":["港人講地"], "en":[] }, 
        "時聞香港": { "hk":["時聞香港"], "en":[] }, 
        "點知天下": { "hk":["點知天下"], "en":[] }
    }, 

    "書商": {
        "聯合出版": { "hk":["聯合出版"], "en":[] }, 
        "中華書局": { "hk":["中華書局"], "en":[] }, 
        "三聯": { "hk":["三聯"], "en":[] }, 
        "商務印": { "hk":["商務印", "商務印書局"], "en":[] }, 
        "萬里機構": { "hk":["萬里機構"], "en":[] }, 
        "新雅文化": { "hk":["新雅文化"], "en":[] }, 
        "聯合電子出版": { "hk":["聯合電子出版"], "en":[] }, 
        "集古齋": { "hk":["集古齋"], "en":[] }, 
        "香港聯合書刊物流": { "hk":["香港聯合書刊物流"], "en":[] }, 
        "博雅藝術": { "hk":["博雅藝術"], "en":[] }
    }, 

    "教育": {
        "蘇文大學": { "hk":["蘇文大學"], "en":["Suwen University"] }, 
        "孔子學院": { "hk":["孔子學院"], "en":["Confucius Institute"] }, 
        "中國學生學者聯合會": { "hk":["中國學生學者聯合會", "中國學生學者聯誼會"], "en":["CSSA", "Chinese Students and Scholars Association"] }
    }, 

    "娛樂": {
        "AMC": { "hk":["AMC電影院"], "en":["AMC"] }, 
        "傳奇影業": { "hk":["傳奇影業", "傳奇娛樂"], "en":["Legendary Pictures"] }, 
        "百利唱片": { "hk":["百利唱片"], "en":[] }, 
        "Hoyts": { "hk":[], "en":["Hoyts"] }, 
        "Odeon": { "hk":[], "en":["Odeon"] }, 
        "Starplex": { "hk":[], "en":["Starplex"] }, 
        "喜羊羊": { "hk":["喜羊羊"], "en":[] }
    }, 

    "Game": {
        "拳頭社": { "hk":["拳頭社"], "en":["Riot Games"] }, 
        "LOL": { "hk":["英雄聯盟"], "en":["League of Legends"] }, 
        "久游": { "hk":["久游"], "en":["Everstar Online"] }, 
        "Eyedentity": { "hk":[], "en":["Eyedentity"] }, 
        "Gameone": { "hk":[], "en":["Gameone"] }, 
        "Garena": { "hk":[], "en":["Garena"] }, 
        "SNK": { "hk":[], "en":["SNK"] }
    }, 

    "Shopping": {
        "淘寶": { "hk":["淘寶"], "en":["Taobao"] }, 
        "U購": { "hk":["U購"], "en":[] }, 
        "名創優品": { "hk":["名創優品"], "en":["MINISO"] }, 
        "天貓": { "hk":["天貓"], "en":[] }, 
        "VanGO": { "hk":[], "en":["VanGO"] }, 
        "中藝": { "hk":["中藝"], "en":[] }, 
        "Coven Garden": { "hk":[], "en":["Coven Garden"] }, 
        "Crabtree & Evelyn": { "hk":[], "en":["Crabtree & Evelyn"] }, 
        "Denham": { "hk":[], "en":["Denham"] }, 
        "Descente": { "hk":[], "en":["Descente"] }, 
        "FILA": { "hk":[], "en":["FILA"] }, 
        "Five Plus": { "hk":[], "en":["Five Plus"] }, 
        "Folli Follie": { "hk":[], "en":["Folli Follie"] }, 
        "GenesisCare": { "hk":[], "en":["GenesisCare", "Genesis Care"] }, 
        "Miss Sixty": { "hk":[], "en":["Miss Sixty"] }, 
        "ochirly": { "hk":[], "en":["ochirly"] }, 
        "Superdry": { "hk":[], "en":["Superdry"] }, 
        "Trendiano": { "hk":[], "en":["Trendiano"] }, 
        "U Weddings": { "hk":[], "en":["U Weddings"] }
    }, 

    "食物": {
        "五豐行": { "hk":["五豐行"], "en":[] }, 
        "北京紫竹藥業": { "hk":["北京紫竹藥業"], "en":[] }, 
        "金威": { "hk":["金威"], "en":[] }, 
        "東阿阿膠": { "hk":["東阿阿膠"], "en":[] }, 
        "Smithfield Foods": { "hk":[], "en":["Smithfield Foods"] }
    }, 

    "餐廳": {
        "麥當勞": { "hk":["麥當勞"], "en":["McDonald's"] }, 
        "富臨": { "hk":["富臨", "囍臨門"], "en":[] }, 
        "Pacific Coffee": { "hk":["太平洋咖啡"], "en":["Pacific Coffee"] }, 
        "Italian Tomato": { "hk":[], "en":["Italian Tomato"] }, 
        "Pokka Cafe": { "hk":[], "en":["Pokka Cafe"] }, 
        "小南國": { "hk":["小南國"], "en":[] }, 
        "小王牛肉麵": { "hk":["小王牛肉麵"], "en":[] }, 
        "惟膳": { "hk":["惟膳"], "en":[] }, 
        "炎丸居酒屋": { "hk":["炎丸居酒屋"], "en":[] }, 
        "白熊咖哩": { "hk":["白熊咖哩"], "en":[] }, 
        "睦美屋": { "hk":["睦美屋"], "en":[] }, 
        "翠華": { "hk":["翠華"], "en":["Tsui Wah"] }, 
        "許留山": { "hk":["許留山"], "en":[] }, 
        "譽宴": { "hk":["譽宴"], "en":[] }, 
        "銀座梅林": { "hk":["銀座梅林"], "en":[] }, 
        "喜記蟹將軍": { "hk":["喜記蟹將軍"], "en":[] }, 
        "強記雞粥": { "hk":["強記雞粥"], "en":[] }
    }, 

    "APP/網頁": {
        "支付寶": { "hk":["支付寶"], "en":["Alipay"] }, 
        "WeChat": { "hk":["微信"], "en":["WeChat"] }, 
        "抖音": { "hk":["抖音"], "en":["Douyin", "Tik Tok"] }, 
        "百度": { "hk":["百度"], "en":["Baidu"] }, 
        "新浪": { "hk":["新浪"], "en":["SINA"] }, 
        "Opera": { "hk":[], "en":["Opera"] }, 
        "互動百科": { "hk":["互動百科"], "en":[] }, 
        "優酷": { "hk":["優酷"], "en":["Youku"] }, 
        "土豆": { "hk":["土豆"], "en":["Tudou"] }, 
        "谷姐": { "hk":["谷姐"], "en":["Goojje"] }
    }, 

    "電話/電腦": {
        "小米": { "hk":["小米"], "en":["Xiaomi"] }, 
        "中興": { "hk":["中興"], "en":["ZTE"] }, 
        "華為": { "hk":["華為"], "en":["Huawei"] }, 
        "Lenovo": { "hk":["聯想"], "en":["Lenovo"] }, 
        "魅族": { "hk":["魅族"], "en":["Meizu"] }, 
        "OnePlus": { "hk":["一加科技"], "en":["OnePlus"] }, 
        "Vivo": { "hk":["維沃"], "en":["Vivo"] }, 
        "OPPO": { "hk":["歐珀"], "en":["OPPO"] }, 
        "Motorola Mobility": { "hk":["摩托羅拉移動"], "en":["Motorola Mobility"] }, 
        "Alcatel": { "hk":["阿爾卡特"], "en":["Alcatel"] }, 
        "TP-Link": { "hk":[], "en":["TP-Link"] }
    }, 

    "電器": {
        "TCL": { "hk":[], "en":["TCL"] }, 
        "海爾": { "hk":["海爾"], "en":[] }, 
        "Fisher & Paykel": { "hk":[], "en":["Fisher & Paykel"] }, 
        "GE Appliances": { "hk":[], "en":["GE Appliances"] }, 
        "Hotpoint": { "hk":[], "en":["Hotpoint"] }
    }, 

    "電訊商": {
        "中國移動": { "hk":["中國移動", "中移動"], "en":[] }, 
        "中國聯通": { "hk":["中國聯通", "中聯通"], "en":["China Unicom"] }
    }, 

    "交通": {
        "西隧": { "hk":["西隧"], "en":[] }, 
        "高鐵": { "hk":["高鐵"], "en":[] }, 
        "噴射飛航": { "hk":["噴射飛航"], "en":["TurboJET"] }
    }, 

    "車廠": {
        "Benelli": { "hk":["貝力尼"], "en":["Benelli"] }, 
        "Geely吉利": { "hk":["吉利汽車"], "en":["Geely"] }, 
        "Volvo": { "hk":["富豪汽車"], "en":["Volvo"] }, 
        "Sunseeker": { "hk":["聖汐克"], "en":["Sunseeker"] }, 
        "Lotus": { "hk":["蓮花汽車"], "en":["Lotus Cars"] }, 
        "Morris Garages": { "hk":[], "en":["Morris Garages"] }, 
        "比亞迪": { "hk":["比亞迪"], "en":["BYD"] }, 
        "金龍": { "hk":["金龍"], "en":["Kinglong"] }, 
        "福田": { "hk":["福田"], "en":["Foton"] }, 
        "東風": { "hk":["東風"], "en":["DongFeng"] }, 
        "江淮": { "hk":["江淮"], "en":["JAC"] }, 
        "華晨": { "hk":["華晨"], "en":[] }, 
        "廣汽": { "hk":["廣汽"], "en":[] }, 
        "五洲龍": { "hk":["五洲龍"], "en":[] }
    },

    "航空公司/旅行社": {
        "海南航空": { "hk":["海南航空"], "en":[] }, 
        "香港航空": { "hk":["香港航空"], "en":[] }, 
        "HK Express": { "hk":["香港快運"], "en":["HK Express", "Hong Kong Express"] }, 
        "中旅社": { "hk":["中國旅行社", "中旅社"], "en":[] }
    }, 

    "酒店/外地旅遊": {
        "地中海俱樂部": { "hk":["地中海俱樂部", "卡尼島度假村", "翡諾島度假村", "愛必濃度假村", "康隆尼角度假村", "普吉島度假村", "民丹島度假村", "巴厘島度假村", "珍拉汀灣度假村", "佐幌度假村", "石垣島度假村"], "en":["Club Med", "Club Méditerranée"] }, 
        "維景酒店": { "hk":["維景酒店"], "en":["Metropark Hotel"] }, 
        "華道夫-阿斯多里亞酒店": { "hk":["華道夫-阿斯多里亞酒店"], "en":["Waldorf Astoria New York"] }, 
        "香榭麗舍萬豪酒店": { "hk":["香榭麗舍萬豪酒店"], "en":["Marriott Champs Elysees Hotel", "Marriott Champs-Elysees Hotel", "Marriott Champs Elysées Hotel", "Marriott Champs-Elysées Hotel", "Marriott Hotel Champs Elysees", "Marriott Hotel Champs-Elysees", "Marriott Hotel Champs Elysées", "Marriott Hotel Champs-Elysées"] }, 
        "Starwood": { "hk":[], "en":["Starwood"] }, 
        "倫敦黑的士": { "hk":["倫敦黑的士"], "en":["black cab", "London taxi", "hackney carriage"] }
    }, 

    "球會": {
        "曼城": { "hk":["曼城"], "en":["Manchester City", "Man City", "MCFC"] }, 
        "愛斯賓奴": { "hk":["愛斯賓奴"], "en":["RCD Espanyol", "Real Club Deportivo Español", "Reial Club Deportiu Espanyol"] }, 
        "ADO海牙": { "hk":["ADO海牙"], "en":["ADO Den Haag", "Alles Door Oefening"] }, 
        "索察": { "hk":["索察"], "en":["Sochaux-Montbéliard", "FC Sochaux", "FCSM"] }, 
        "布拉格斯拉維亞": { "hk":["布拉格斯拉維亞"], "en":["SK Slavia Prague", "Slavia Prague", "Slavia Praha"] }
    }
}
LaHKPoliceNe commented 6 years ago

改 json format 係 Part 1 嚟 Part 2 補返漏咗嘅中文/英文/簡寫 Part 3 仲有一條好長嘅 list 等你加入去