跳转到内容
主菜单
主菜单
移至侧栏
隐藏
导航
首页
最近更改
随机页面
社群首页
帮助
希顶相关网站
希顶社区官网
希服维基
Nyoeghau翻译器
〇改希顶转写器
语圈山海经
搜索
搜索
外观
创建账号
登录
个人工具
创建账号
登录
查看“︁User:ColorfulGalaxy/Programs”︁的源代码
用户页
讨论
不转换
不转换
简体
繁體
新加坡简体
阅读
查看源代码
查看历史
工具
工具
移至侧栏
隐藏
操作
阅读
查看源代码
查看历史
常规
链入页面
相关更改
用户贡献
日志
查看用户组
特殊页面
页面信息
查看头像
外观
移至侧栏
隐藏
←
User:ColorfulGalaxy/Programs
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于这些用户组的用户执行:
用户
、storagereadable
您必须确认您的电子邮件地址才能编辑页面。请通过
参数设置
设置并确认您的电子邮件地址。
您可以查看和复制此页面的源代码。
== xdi8tools.py == Unfortunately, I still have no idea how to obtain the entire Shidinn dictionary database (including {{x|obiT}}). <pre>from xdict import dict_xdi8 # dict_xdi8 is a Shidinn dictionary e.g. { '一':'NV','二':'42' } b1i45=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,(0),0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,44,39,42,22,23,38,26,41,0,0,0,0,0,0,0, 0,35,27,0,11,34,25,0,14,0,0,0,37,0,15,0, 0,0,0,0,40,0,43,0,0,36,0,0,0,0,0,0, 0,31,1,28,17,33,29,19,21,45,5,20,16,3,9,32, 2,6,13,12,18,30,24,4,7,8,10,0,0,0,0,0,0]+65535*[0] b1i90000=[(((i-1)%9+1) * (10**((i-1)//9))if i!=0 else 0) for i in b1i45] xdi8hanzi=list(dict_xdi8.keys()) def b1i45encode(word): return ' '.join((str(b1i45[ord(q)]) if len(str(b1i45[ord(q)]))>=2 else '0'+str(b1i45[ord(q)])) for q in word) def b1i90000sum(word): return sum([b1i90000[ord(q)] for q in word]) def translate_into_xdi8(word,sep=''): return sep.join((dict_xdi8[q] if (q in xdi8hanzi) else q) for q in word)</pre> == [[荆哲歌单|Infinite song list]] tools == The chart will be placed in [[User:ColorfulGalaxy/荆哲歌单/可排序表格]]. (citation needed) === Convert json to python dictionary === Takes [[Module:Songlist-brief.json]] as input. <pre>import json with open("songlist-brief-03472a.json","r",encoding="utf-8") as f: data=json.load(f) with open("songlist_brief_03472a.py","w",encoding="utf-8") as g: print('songlist=',data,file=g) print('done') </pre> === Convert python dictionary to wiki chart === New columns added. You can help us expand it. <pre>from songlist_brief_03472a import songlist import sys import os.path from xdi8tools import * songnumbers=list(songlist['songlist'].keys()) # xdi8aho translation exception xdi8exlist={ '0':'He f8 k2 Huo k2 miLh', '239':'jbia rA xue', } xdi8exlistk=list(xdi8exlist.keys()) def xdi8titleof(num1,sep1=''): return (xdi8exlist[num1].replace(' ','') if sep1=='' else xdi8exlist[num1]) if num1 in xdi8exlistk else translate_into_xdi8(songlist['songlist'][songnumbers[p]]['song']['name'],sep=sep1) timelist={ '0':'0' } timelistk=list(timelist.keys()) keylist={ '0':'0' } keylistk=list(keylist.keys()) keymodlist={ '0':'0' } keymodlistk=list(keymodlist.keys()) titleclasslist={ '0':1 } titleclasslistk=list(titleclasslist.keys()) # 30 day song challenge tdsclist={ } tdsclistk=list(tdsclist.keys()) saltdatelist={ } saltdatelistk=list(saltdatelist.keys()) rhythmgamesonglist={ } rhythmgamesonglistk=list(rhythmgamesonglist.keys()) f=open("songlist-wikifile.txt","w",encoding="utf-8") f.write("\'\'\'Lucas Song List\'\'\', also called the Infinite Song List, is a system organized by Lucas that maps popular songs to integers in a somewhat mathematical manner. \n") f.write("The current database version is 03472a. The list below may contain errors, mainly because the Shidinn translator (programmed manually by ColorfulGalaxy) is unable to handle homograph.\n\n") f.write("{| class=\"wikitable sortable\"\n"); f.write("! Number !! Song title !! Singers !! Title in Shidinn !! b1i45 index !! Shidinn numeral sum !! Time signature !! Key signature !! Key modulation (half-steps) !! [http://puzzling.stackexchange.com/questions/106137 Title category] !! Day # in<br>original<br>30-day song<br>challenge !! Salt song guess date !! 与之 旋律/和声/节奏/曲风 相近的音游曲目\n"); for p in range(len(songnumbers)): f.write("|-\n") f.write("| "+songnumbers[p]+" || ") f.write(songlist['songlist'][songnumbers[p]]['song']['name']+" || "+','.join(songlist['songlist'][songnumbers[p]]['song']['singers'])+" || ") f.write(xdi8titleof(songnumbers[p],sep1=' ')+" || ") f.write(b1i45encode(xdi8titleof(songnumbers[p]))[0:17]+" || ") f.write(str(b1i90000sum(xdi8titleof(songnumbers[p])))+" || ") f.write((timelist[songnumbers[p]]if songnumbers[p] in timelistk else '')+" || "); f.write((keylist[songnumbers[p]]if songnumbers[p] in keylistk else '')+" || "); f.write((keymodlist[songnumbers[p]]if songnumbers[p] in keymodlistk else '')+" || "); f.write(str(titleclasslist[songnumbers[p]]if songnumbers[p] in titleclasslistk else '')+" || "); f.write((tdsclist[songnumbers[p]]if songnumbers[p] in tdsclistk else '')+" || "); f.write((saltdatelist[songnumbers[p]]if songnumbers[p] in saltdatelistk else '')+" || "); f.write((rhythmgamesonglist[songnumbers[p]]if songnumbers[p] in rhythmgamesonglistk else '')+"\n"); # TODO f.write("|}") f.close() </pre> == Older programs == Chart generator (August 2025 - a new version using custom xdi8tools module should be uploaded) <pre class="mw-collapsible">import sys import os.path import pypinyin import xdi8string # all the characters spaced out translated into shidinn f=open("wikifile.txt","w",encoding="utf-8") characters=[chr(i) for i in range(0x4e00,0xa000)] plaintext=' '.join(chr(n) for n in range(0x4e00,0xa000)) ciphertext=xdi8string.output b1i45=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,(0),0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,44,39,42,22,23,38,26,41,0,0,0,0,0,0,0, 0,35,27,0,11,34,25,0,14,0,0,0,37,0,15,0, 0,0,0,0,40,0,43,0,0,36,0,0,0,0,0,0, 0,31,1,28,17,33,29,19,21,45,5,20,16,3,9,32, 2,6,13,12,18,30,24,4,7,8,10,0,0,0,0,0,0] b1i90000=[(((i-1)%9+1) * (10**((i-1)//9))if i!=0 else 0) for i in b1i45] def b1i45encode(word): return ' '.join((str(b1i45[ord(q)]) if len(str(b1i45[ord(q)]))>=2 else '0'+str(b1i45[ord(q)])) for q in word) def b1i90000sum(word): return sum([b1i90000[ord(q)] for q in word]) plain=plaintext.split() cipher=ciphertext.split() maxlength=0 maxlench=[] f.write("Do not simply rely on this chart to translate, as this chart did not handle [[talk:希顶日本语#注意多音字|homograph]] properly. The calculation may be incorrect. If so, please fix it.") f.write("{| class=\"wikitable sortable\"\n"); f.write("! Character !! Unicode decimal !! Stroke count !! han4 yu3 pin1 yin1 !! xdi8 aho !! [[b1i45密码|b1i45]] !! xdi8 aho letter count !! [[希顶解经|Numeral sum]] !! Stress pattern !! Notes\n") for p in range(len(plain)): if(plain[p]!=cipher[p]): f.write("|-\n"); f.write("| "+plain[p]+" || ") f.write(str(ord(plain[p]))) f.write(" || || ") f.write(pypinyin.pinyin(characters[p],style=pypinyin.Style.TONE3,neutral_tone_with_five=True)[0][0]) f.write(" || "+cipher[p]) f.write(" || "+b1i45encode(cipher[p])) f.write(" || "+str(len(cipher[p]))) f.write(" || "+str(b1i90000sum(cipher[p])) + "\n") if(maxlength<len(cipher[p])): maxlench=[p] maxlength=len(cipher[p]) elif(maxlength<=len(cipher[p])): maxlench+=[p] f.write("|}") print(maxlench,maxlength,len(maxlench)) f.close(); </pre>
该页面使用的模板:
Template:Improved
(
查看源代码
)
Template:Info
(
查看源代码
)
Template:Mbox
(
查看源代码
)
Template:X
(
查看源代码
)(受保护)
Template:有待完善
(
查看源代码
)
Template:页面型别
(
查看源代码
)
Module:Arguments
(
查看源代码
)
Module:Xd
(
查看源代码
)(受保护)
返回
User:ColorfulGalaxy/Programs
。