Last active
December 30, 2017 16:02
-
-
Save kemsakurai/6c287eab5aa45415bf5c50df1e61a47f to your computer and use it in GitHub Desktop.
Google Analytics アフィニティカテゴリ の 翻訳 TSV ファイル と 翻訳ファイルで翻訳する python スクリプト
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
英語名 | 日本語名 | |
---|---|---|
30 Minute Chefs | お手軽クッキング愛好家 | |
Action & Adventure Movie Fans | アクション映画 | |
Action Game Fans | アクションゲーム | |
Adventure & Strategy Game Fans | アドベンチャー・戦略ゲーム | |
American Football Fans | アメフト | |
Art & Theater Aficionados | 芸術・芝居マニア | |
Aspiring Chefs | 料理人を目指している人 | |
Australian Football Fans | オーストラリアンフットボール | |
Auto Enthusiasts | 自動車愛好家 | |
Avid Investors | 熱心な投資家 | |
Banking & Finance | 銀行&金融 | |
Bargain Hunters | バーゲン | |
Baseball Fans | 野球 | |
Basketball Fans | バスケッ | |
Beachbound Travelers | 海の見える地域 | |
Beauty & Wellness | 美容&健康 | |
Beauty Mavens | 美容の達人 | |
Blues Fans | ブルース | |
Boating & Sailing Enthusiasts | 波乗りスポーツ | |
Book Lovers | 書籍愛好家 | |
Business & Economic News Junkies | ビジネス・経済情報 | |
Business Professionals | ビジネス専門家 | |
Business Travelers | ビジネス旅行者 | |
Casual & Social Gamers | ミニゲーム・ソーシャルゲーム | |
Cat Lovers | ネコ好き | |
Classical Music Enthusiasts | クラシック音楽 | |
Comedy Movie Fans | コメディー映画 | |
Comics & Animation Fans | マンガ・アニメ好き | |
Cooking Enthusiasts | 料理愛好家 | |
Country Music Fans | カントリーミュージック | |
Cricket Enthusiasts | クリケット | |
Cycling Enthusiasts | サイクリング | |
Do-It-Yourselfers | 日曜大工愛好家 | |
Documentary & Nonfiction TV Fans | ドキュメンタリー | |
Dog Lovers | 犬好き | |
Driving & Racing Game Fans | ドライブ・レースゲーム | |
Electronica & Dance Music Fans | ダンスミュージック | |
Entertainment & Celebrity News Junkies | エンターテイメント&セレブニュース | |
Family Movie Fans | 家族映画 | |
Family Television Fans | 家族向け番組 | |
Family Vacationers | 家族旅行 | |
Family-Focused | 家族重視 | |
Fashionistas | ファッション愛好家 | |
Fast Food Cravers | ファーストフード中毒 | |
Fight & Wrestling Fans | 格闘&レスリング | |
Folk & Traditional Music Enthusiasts | 民謡·伝統 | |
Food & Dining | フード&ダイニング | |
Foodies | 食い道楽 | |
Game, Reality & Talk Show Fans | ゲーム、ドキュメント&トーク番組 | |
Gamers | ゲーマー | |
Golf Enthusiasts | ゴルフ | |
Green Living Enthusiasts | エコ生活愛好者 | |
Hardcore Gamers | 筋金入りのゲーマー | |
Health & Fitness Buffs | 健康・フィットネス通 | |
Hockey Fans | ホッケー | |
Home & Garden | ホーム&ガーデン | |
Home Decor Enthusiasts | インテリア愛好家 | |
Horror Movie Fans | ホラー映画 | |
Indie & Alternative Rock Fans | インディー・ロック | |
Jazz Enthusiasts | ジャズ | |
Lifestyles & Hobbies | ライフスタイル&趣味 | |
Local News Junkies | ローカルニュース | |
Luxury Shoppers | 高価な買い物 | |
Luxury Travelers | 贅沢な旅行 | |
Media & Entertainment | メディア&エンターテイメント | |
Men’s Media Fans | 男性メディア | |
Metalheads | メタル | |
Mobile Enthusiasts | モバイル愛好家 | |
Motor Sports Enthusiasts | モータースポーツ | |
Motorcycle Enthusiasts | オートバイ愛好家 | |
Movie Lovers | 映画愛好家 | |
Music Lovers | 音楽愛好家 | |
News & Politics | ニュース&政治 | |
News Junkies | ニュース好き | |
News Junkies & Avid Readers | ニュース好き&本好き | |
Nightlife Enthusiasts | 夜遊び好き | |
Outdoor Enthusiasts | アウトドア愛好家 | |
Performance & Luxury Vehicle Enthusiasts | 高性能車・高級車愛好家 | |
Pet Lovers | 動物好き | |
Political Junkies | 政治マニア | |
Political News Junkies | 政治情報 | |
Pop Music Fans | ポップ | |
Racquetball Enthusiasts | ラケットボール | |
Rap & Hip Hop Fans | ラップ&ヒップホップ | |
Rock Music Fans | ロック | |
Roleplaying Game Fans | RPG愛好家 | |
Romance & Drama Movie Fans | 恋愛映画 | |
Rugby Enthusiasts | ラグビー | |
Running Enthusiasts | ランニング | |
Sci-Fi & Fantasy Movie Fans | ファンタジー映画 | |
Sci-Fi & Fantasy TV Fans | ファンタジー番組 | |
Shooter Game Fans | シューティングゲーム | |
Shopaholics | 買い物中毒 | |
Shoppers | 買い物好き | |
Shutterbugs | アマチュア写真家 | |
Skiing Enthusiasts | スキー | |
Snowbound Travelers | 雪深い地域 | |
Soccer Fans | サッカー | |
Social Media Enthusiasts | ソーシャルメディア愛好家 | |
South Asian Film Fans | 南アジア映画 | |
Spanish-Language Music Fans | スペイン音楽 | |
Sports & Fitness | スポーツ&フィットネス | |
Sports Fans | スポーツ好き | |
Sports Game Fans | スポーツゲーム | |
Swimming Enthusiasts | 水泳 | |
Technology | 技術 | |
Technophiles | 新技術好き | |
Tennis Enthusiasts | テニス | |
Thrill Seekers | スリル好き | |
Travel | 旅行 | |
Travel Buffs | 旅行好き | |
Truck & SUV Enthusiasts | トラック・SUV愛好家 | |
TV Comedy Fans | バラエティー | |
TV Drama Fans | ドラマ | |
TV Lovers | テレビ好き | |
Value Shoppers | 価格重視 | |
Vehicles & Transportation | 自動車&輸送 | |
Water Sports Enthusiasts | マリンスポーツ | |
Winter Sports Enthusiasts | ウィンタースポーツ | |
Women's Media Fans | 女性のメディアファン | |
Women’s Media Fans | 女性メディア | |
World Music Fans | 世界の音楽 | |
World News Junkies | 世界のニュース |
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
30 Minute Chefs | |
Action & Adventure Movie Fans | |
Action Game Fans | |
Adventure & Strategy Game Fans | |
American Football Fans | |
Art & Theater Aficionados | |
Aspiring Chefs | |
Australian Football Fans | |
Auto Enthusiasts | |
Avid Investors | |
Banking & Finance | |
Bargain Hunters | |
Baseball Fans | |
Basketball Fans | |
Beachbound Travelers | |
Beauty & Wellness | |
Beauty Mavens | |
Blues Fans | |
Boating & Sailing Enthusiasts | |
Book Lovers | |
Business & Economic News Junkies | |
Business Professionals | |
Business Travelers | |
Casual & Social Gamers | |
Cat Lovers | |
Classical Music Enthusiasts | |
Comedy Movie Fans | |
Comics & Animation Fans | |
Cooking Enthusiasts | |
Country Music Fans | |
Cricket Enthusiasts | |
Cycling Enthusiasts | |
Do-It-Yourselfers | |
Documentary & Nonfiction TV Fans | |
Dog Lovers | |
Driving & Racing Game Fans | |
Electronica & Dance Music Fans | |
Entertainment & Celebrity News Junkies | |
Family Movie Fans | |
Family Television Fans | |
Family Vacationers | |
Family-Focused | |
Fashionistas | |
Fast Food Cravers | |
Fight & Wrestling Fans | |
Folk & Traditional Music Enthusiasts | |
Food & Dining | |
Foodies | |
Game, Reality & Talk Show Fans | |
Gamers | |
Golf Enthusiasts | |
Green Living Enthusiasts | |
Hardcore Gamers | |
Health & Fitness Buffs | |
Hockey Fans | |
Home & Garden | |
Home Decor Enthusiasts | |
Horror Movie Fans | |
Indie & Alternative Rock Fans | |
Jazz Enthusiasts | |
Lifestyles & Hobbies | |
Local News Junkies | |
Luxury Shoppers | |
Luxury Travelers | |
Media & Entertainment | |
Men’s Media Fans | |
Metalheads | |
Mobile Enthusiasts | |
Motor Sports Enthusiasts | |
Motorcycle Enthusiasts | |
Movie Lovers | |
Music Lovers | |
News & Politics | |
News Junkies | |
News Junkies & Avid Readers | |
Nightlife Enthusiasts | |
Outdoor Enthusiasts | |
Performance & Luxury Vehicle Enthusiasts | |
Pet Lovers | |
Political Junkies | |
Political News Junkies | |
Pop Music Fans | |
Racquetball Enthusiasts | |
Rap & Hip Hop Fans | |
Rock Music Fans | |
Roleplaying Game Fans | |
Romance & Drama Movie Fans | |
Rugby Enthusiasts | |
Running Enthusiasts | |
Sci-Fi & Fantasy Movie Fans | |
Sci-Fi & Fantasy TV Fans | |
Shooter Game Fans | |
Shopaholics | |
Shoppers | |
Shutterbugs | |
Skiing Enthusiasts | |
Snowbound Travelers | |
Soccer Fans | |
Social Media Enthusiasts | |
South Asian Film Fans | |
Spanish-Language Music Fans | |
Sports & Fitness | |
Sports Fans | |
Sports Game Fans | |
Swimming Enthusiasts | |
Technology | |
Technophiles | |
Tennis Enthusiasts | |
Thrill Seekers | |
Travel | |
Travel Buffs | |
Truck & SUV Enthusiasts | |
TV Comedy Fans | |
TV Drama Fans | |
TV Lovers | |
Value Shoppers | |
Vehicles & Transportation | |
Water Sports Enthusiasts | |
Winter Sports Enthusiasts | |
Women's Media Fans | |
Women’s Media Fans | |
World Music Fans | |
World News Junkies |
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
import requests | |
translation_dictionary = {} | |
def create_dictionary(): | |
r = requests.get("https://gist.githubusercontent.com/kemsakurai/6c287eab5aa45415bf5c50df1e61a47f/raw/3ea1cf361a8914ad20c70ac46e8473e2590597e9/AffinityCategoryTranslation.tsv") | |
lines = r.text.split("\n") | |
index = 0 | |
for line in lines: | |
index = index + 1 | |
if index == 1: | |
continue | |
elems = line.split("\t") | |
translation_dictionary.update({elems[0]: elems[1]}) | |
def translate_affinity_category(english_string): | |
results = [] | |
for elem in english_string.split("/"): | |
results.append(translation_dictionary.get(elem, "undefined")) | |
return '/'.join(results) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment