Skip to content

Latest commit

 

History

History
144 lines (126 loc) · 2.14 KB

生成键值对.md

File metadata and controls

144 lines (126 loc) · 2.14 KB

neovim-practise-101-生成键值对

Origin text1

word,tree,bear,moon,lamp,rain,hair,fire,book,door,song,fish,ship,star,sand,time,bell,corn,team,road,cake,duck,read,boat,lion,desk,walk,play,hand,kiss,rock,salt,baby,jump,zone,mind,bird,dust,game,spin,frog,foot,idea,open,home,seed,wind,snow

变成每两列为一行后

word,tree,
bear,moon,
lamp,rain,
hair,fire,
book,door,
song,fish,
ship,star,
sand,time,
bell,corn,
team,road,
cake,duck,
read,boat,
lion,desk,
walk,play,
hand,kiss,
rock,salt,
baby,jump,
zone,mind,
bird,dust,
game,spin,
frog,foot,
idea,open,
home,seed,
wind,snow

变成带引号的键值对后

"word":"tree",
"bear":"moon",
"lamp":"rain",
"hair":"fire",
"book":"door",
"song":"fish",
"ship":"star",
"sand":"time",
"bell":"corn",
"team":"road",
"cake":"duck",
"read":"boat",
"lion":"desk",
"walk":"play",
"hand":"kiss",
"rock":"salt",
"baby":"jump",
"zone":"mind",
"bird":"dust",
"game":"spin",
"frog":"foot",
"idea":"open",
"home":"seed",
"wind":"snow"

取出所有值并粘贴至此后

tree
moon
rain
fire
door
fish
star
time
corn
road
duck
boat
desk
play
kiss
salt
jump
mind
dust
spin
foot
open
seed
snow

Origin text2

word trees, bear moondd dfds_dd
world like a trees, baar moondd dfds_dd
aword bbar, trees moondd dfds_dd
bword trees, moondd bcar dfds_dd
trees cord, dfds_dd bdar moondd
dord trees, rear moondd dfds_dd

变成带引号的键值对后

"word trees": "bear moondd dfds_dd",
"world like a trees": "baar moondd dfds_dd",
"aword bbar": "trees moondd dfds_dd",
"bword trees": "moondd bcar dfds_dd",
"trees cord": "dfds_dd bdar moondd",
"dord trees": "rear moondd dfds_dd",

变成 Python 字典后

mapping = {
    "word trees": "bear moondd dfds_dd",
    "world like a trees": "baar moondd dfds_dd",
    "aword bbar": "trees moondd dfds_dd",
    "bword trees": "moondd bcar dfds_dd",
    "trees cord": "dfds_dd bdar moondd",
    "dord trees": "rear moondd dfds_dd",
}

将 Python 字典的所有 Value 字符粘贴至此后

bear moondd dfds_dd
baar moondd dfds_dd
trees moondd dfds_dd
moondd bcar dfds_dd
dfds_dd bdar moondd
rear moondd dfds_dd

Answer

TODO