跳至內容

維基百科:機器用戶/申請/存檔/2017年

維基百科,自由的百科全書
狀態:   申請者撤回
申請者/獲提名者:蘭斯特討論頁 · 貢獻 · 已刪貢獻 · 編輯報告 · 所創條目 · 日誌 · 註冊日期 · 封鎖日誌 · 授予權限|資格檢查:巡查權 · 回退權 · 自動確認用戶
用途︰ {{Infobox company}} 參數替換
自動化程度︰半自動。
程式語言︰reg
源代碼連結︰這麼簡單不用給吧
討論內容連結(如有)︰[1]
編輯時段及頻率︰
受影響頁面︰Category:公司信息框使用額外地區代碼參數的頁面
申請人︰米莉婭諾朵卡 2017年12月28日 (四) 02:40 (UTC)
狀態:   完成
申請者/獲提名者:Tigerzeng討論頁 · 貢獻 · 已刪貢獻 · 編輯報告 · 所創條目 · 日誌 · 註冊日期 · 封鎖日誌 · 授予權限|資格檢查:巡查權 · 回退權 · 自動確認用戶
用途︰翻譯外文章節標題
自動化程度︰人類監督下運行
程式語言︰Python
源代碼連結︰
討論內容連結(如有)︰
編輯時段及頻率︰預計10-20次/分鐘
受影響頁面︰存在下列章節標題的頁面,預計200個左右
申請人︰Tiger留言2017年7月22日 (六) 13:59 (UTC)
  • 包括:
    • References→參考資料
    • External links→外部連結
    • Notes→註釋
    • See also→參見

--Tiger留言2017年7月22日 (六) 13:59 (UTC)

狀態:   完成
申請者/獲提名者:蘭斯特討論頁 · 貢獻 · 已刪貢獻 · 編輯報告 · 所創條目 · 日誌 · 註冊日期 · 封鎖日誌 · 授予權限|資格檢查:巡查權 · 回退權 · 自動確認用戶
用途︰建立上層分類
自動化程度︰半自動
程式語言︰
源代碼連結︰
討論內容連結(如有)︰
編輯時段及頻率︰半自動至完成
受影響頁面︰僅分類頁面,約400個+上層分類
申請人︰Zest 2017年7月25日 (二) 02:29 (UTC)
狀態:   未完成
申請者/獲提名者:Hamishcn討論頁 · 貢獻 · 已刪貢獻 · 編輯報告 · 所創條目 · 日誌 · 註冊日期 · 封鎖日誌 · 授予權限|資格檢查:巡查權 · 回退權 · 自動確認用戶
用途︰增補分類
自動化程度︰半自動
程式語言︰
源代碼連結︰
討論內容連結(如有)︰
編輯時段及頻率︰半自動至完成
受影響頁面︰Category:中國城市軌道交通內部分車站條目。
申請人︰ Creampie 2017年10月13日 (五) 05:51 (UTC)
Creampie君︰所請問是增補什麼分類呀?--J.Wong 2017年10月14日 (六) 06:16 (UTC)
Wong128hk意圖將上述分類中車站條目分類入以該車站所在線路之分類,具體閣下請參見用戶貢獻/Hamishcn。-- Creampie 2017年10月14日 (六) 06:38 (UTC)


狀態:   未完成
申請者/獲提名者:AndyAndyAndyAlbert討論頁 · 貢獻 · 已刪貢獻 · 編輯報告 · 所創條目 · 日誌 · 註冊日期 · 封鎖日誌 · 授予權限|資格檢查:巡查權 · 回退權 · 自動確認用戶
用途︰移動分類及將分類內頁面移動
自動化程度︰半自動 Cat-a-lot
程式語言︰
源代碼連結︰
討論內容連結(如有)︰
編輯時段及頻率︰5-15/min
受影響頁面︰分類頁面如Category:香港1955年-〉Category:1955年香港
申請人︰安迪4討論|留名2017年12月19日 (二) 05:32 (UTC)
狀態:   授權
申請者/獲提名者:A2569875討論頁 · 貢獻 · 已刪貢獻 · 編輯報告 · 所創條目 · 日誌 · 註冊日期 · 封鎖日誌 · 授予權限|資格檢查:巡查權 · 回退權 · 自動確認用戶
用途︰主要目的是「讓需要校對CAS號的條目加入分類」,不影響條目文字敘述內容
最終目的 : 為了User:A2569875-bot的啟動而做的事前準備
此工作完成後還要代User:Leiem用其學術帳戶協助校對
自動化程度︰程式全自動 (我會在運作過程監控)
我這個流程是
  1. 向英文維基檢查其CAS號是否已有維基人校對過
  2. 是的話,順便也把其他化學品編號也移動中文維基
  3. 移成功的話,使條目移除分類:未提供參考文獻的CAS號
  4. 否的話,加入分類:含有未校對CAS號的條目
程式語言︰C++/CLI
源代碼連結︰同User:A2569875-bot,更動的函數如下

有些英文維基也沒校正的會手動加入| CASNo_Ref = {{cascite|changed|??}}

註:此處原有文字,因為原本的程式碼在IRC上討論認為不適合,已由-- 宇帆(明年二月加入維基將滿十周年!留言·歡迎簽到·聯絡)於2017年12月30日 (六) 20:33 (UTC)刪除,尚祈見諒。若有異議請至互助客棧或向管理員反映。

討論內容連結(如有)︰於IRC
編輯時段及頻率︰核准後立即啟動直至跑完
受影響頁面︰Category:未提供參考文獻的CAS號(於IRC討論期間列出的1,801個頁面)
申請人︰-- 宇帆(明年二月加入維基將滿十周年!留言·歡迎簽到·聯絡2017年12月25日 (一) 13:48 (UTC)
代碼編寫中...先擱置,根據IRC討論,Code需要更改-- 宇帆(明年二月加入維基將滿十周年!留言·歡迎簽到·聯絡2017年12月26日 (二) 04:44 (UTC)
新的Code,相關.Net庫(花三天寫的)程式碼包括WikiUtils.csWikiCasCheckTool.csWikiTemplateArgUtil.csWikiParsingProcess.csWikiParsingDatatype.csWikiEntityDatatype.cs
最重要的部分(以C++/CLI)執行編輯動作的程式碼如下:
程式碼 (有點長,因此隱藏,要看得請點開閱讀)
void check_cas_is_check_or_not_and_mark_redirect(Site^ zhWiki, Site^ enWiki, System::Collections::Generic::List<System::String^>^ page_result) {
	created_page = false;
	if (page_result->Count > 0) {
		Page^ the_page = gcnew Page(zhWiki, page_result[0]);

		System::String^ orginal_string = "";

		System::Collections::Generic::List<System::String^>^ wikidata1 = the_page->GetWikidataLinks();
		System::String^ wikidataen = the_page->GetEnWikiPageName();

		bool have_enwiki = true;

		//I need optional binding!!!!! this is not swift....
		if (wikidataen != nullptr) {
			have_enwiki = false;
			if (!((gcnew System::String(""))->Equals(wikidataen))) {
				Page^ the_en_page = gcnew Page(enWiki, wikidataen);
				the_page->Load();
				the_en_page->Load();

				orginal_string = gcnew System::String(the_page->text);

				ParsedWikiText^ zh_page_parsing_tree = gcnew ParsedWikiText(the_page->text);
				ParsedWikiText^ en_page_parsing_tree = gcnew ParsedWikiText(the_en_page->text);

				std::cout << "Construct WikiText Parsing Tree... " << std::endl;
				zh_page_parsing_tree->Parse();
				en_page_parsing_tree->Parse();
				std::cout << "Parse Complete!" << std::endl;

				WikiTemplate^ zh_Chembox_Identifiers = wikitext_util::
					FindTemplate("Chembox Identifiers", zh_page_parsing_tree->parsed_result);
				WikiTemplate^ en_Chembox_Identifiers = wikitext_util::
					FindTemplate("Chembox Identifiers", en_page_parsing_tree->parsed_result);

				if (zh_Chembox_Identifiers != nullptr && en_Chembox_Identifiers != nullptr) {
					System::Collections::Generic::List<cas_checker^>^ zh_cas_list = wikitext_util::
						getCasNos(zh_Chembox_Identifiers);
					System::Collections::Generic::List<cas_checker^>^ en_cas_list = wikitext_util::
						getCasNos(en_Chembox_Identifiers);

					System::Text::RegularExpressions::Regex^ some_one_checked = gcnew System::Text::RegularExpressions::
						Regex("\\|[ _]*[Cc]orrect[ _]*\\|");

					System::Collections::Generic::List<cas_checker^>^ merged_caslist = gcnew System::Collections::Generic::List<cas_checker^>();
					for (int i = 0; i < zh_cas_list->Count; ++i) {
						cas_checker^ temp_cas = gcnew cas_checker(zh_cas_list[i]->cas_no, "");
						temp_cas->cas_comment = zh_cas_list[i]->cas_comment;
						if (some_one_checked->IsMatch(zh_cas_list[i]->cas_ref)) {
							temp_cas->cas_ref = zh_cas_list[i]->cas_ref;
						}
						merged_caslist->Add(temp_cas);
					}
					for (int i = 0; i < en_cas_list->Count; ++i) {
						bool to_be_continue = false;
						for (int j = 0; j < merged_caslist->Count; ++j) {
							if (merged_caslist[j]->cas_no == en_cas_list[i]->cas_no) {
								if (merged_caslist[j]->cas_comment == "" && en_cas_list[i]->cas_comment != "")
									merged_caslist[j]->cas_comment = en_cas_list[i]->cas_comment;
								if (en_cas_list[i]->cas_ref != "") {
									if (some_one_checked->IsMatch(en_cas_list[i]->cas_ref)) {
										merged_caslist[j]->cas_ref = en_cas_list[i]->cas_ref;
									}
									else if (!some_one_checked->IsMatch(merged_caslist[j]->cas_ref)) {
										merged_caslist[j]->cas_ref = en_cas_list[i]->cas_ref;
									}
								}
								else if (merged_caslist[j]->cas_ref == "" && en_cas_list[i]->cas_ref != "")
									merged_caslist[j]->cas_ref = en_cas_list[i]->cas_ref;
								to_be_continue = true;
								break;
							}
						}
						if (to_be_continue)continue;
						cas_checker^ temp_cas = gcnew cas_checker(en_cas_list[i]->cas_no, "");
						temp_cas->cas_comment = en_cas_list[i]->cas_comment;
						merged_caslist->Add(temp_cas);
					}
					for (int i = 0; i < merged_caslist->Count; ++i) {
						if (merged_caslist[i]->cas_ref == "") {
							merged_caslist[i]->cas_ref = "{{cascite|changed|??}}";
						}
					}

					wikitext_util::MergeTemplate(en_Chembox_Identifiers, zh_Chembox_Identifiers);
					wikitext_util::AddCasNoToChemboxIdentifiers(zh_Chembox_Identifiers, merged_caslist);
					the_page->text = the_page->text->Replace((the_page->text->Substring(zh_Chembox_Identifiers->start_pos,
						zh_Chembox_Identifiers->stop_pos - zh_Chembox_Identifiers->start_pos - 1
					)), zh_Chembox_Identifiers->genCode());

					if (the_page->text != orginal_string) {
						//the_page->text = nextPortionRegex->Replace(the_page->text, match->Value);
						//the_page->Save("[[WP:FF|機器用戶]]:清理[[Category:未提供參考文獻的CAS號]]", false);
						the_page->Save("在監控下進行測試,目標:清理[[Category:未提供參考文獻的CAS號]]", false);
						created_page = true;
					}

					std::cout << the_page->text << std::endl;
					goto Will_Exit;
				}
			}
		}
Will_Exit:
		page_result->RemoveAt(0);
	}
	else {
		should_close = true;
	}
}
-- 宇帆(明年二月加入維基將滿十周年!留言·歡迎簽到·聯絡2017年12月30日 (六) 20:42 (UTC)
  • 其做法為:
    1. 解析整個WikiText語法
    2. 從Parsing Tree 抓出{{Chembox Identifiers}}模板
    3. 從英文區與中文區找出CAS號列表,同時包含CAS號的校對情況
    4. 若對應CAS號 英文區 已校對過,中文區未校對過,將英文區貼到中文區,並標記已校對
    5. 若對應CAS號 英文區 未校對過,中文區未校對過,不改動,直接標記未校對
    6. 若對應CAS號 英文區 未校對過,中文區已校對過,不改動,直接標記已校對
    7. 以上的「從英文區貼到中文區」動作,「若中文區已經有文字」,則不動作
    8. 其餘非CAS號之化學品識別遵從「若中文區已經有文字」,則不動作,的添補動作
    9. 最後將{{Chembox Identifiers}}模板的內容更新
      • 在記憶體中的化學品識別可能會有排序不同的狀況
    10. 若頁面有改動,則儲存頁面。
狀態:   駁回
申請者/獲提名者:AndyAndyAndyAlbert討論頁 · 貢獻 · 已刪貢獻 · 編輯報告 · 所創條目 · 日誌 · 註冊日期 · 封鎖日誌 · 授予權限|資格檢查:巡查權 · 回退權 · 自動確認用戶
用途︰批量建立熱帶氣旋重定向
自動化程度︰半自動,有錯誤即G10。
程式語言︰
源代碼連結︰ToolsRedirect
討論內容連結(如有)︰未有
編輯時段及頻率︰每分鐘少於等於13次
受影響頁面︰熱帶氣旋地區詞頁面
申請人︰安迪4討論|留名2017年12月26日 (二) 13:34 (UTC)
狀態:   未完成
申請者/獲提名者:Snghrax討論頁 · 貢獻 · 已刪貢獻 · 編輯報告 · 所創條目 · 日誌 · 註冊日期 · 封鎖日誌 · 授予權限|資格檢查:巡查權 · 回退權 · 自動確認用戶
用途︰大批量為中國大陸地級、縣級行政區劃討論頁添加專題模板
自動化程度︰半自動
程式語言︰
源代碼連結︰
討論內容連結(如有)︰
編輯時段及頻率︰每分鐘5-10次
受影響頁面︰中國大陸縣級行政區劃討論頁
申請人︰—— 呆呆|ω・`) 捕捉 | 爪跡 2017年12月31日 (日) 11:44 (UTC)
我只有明天17點之前有空,希望能儘快授權—— 呆呆|ω・`) 捕捉 | 爪跡 2017年12月31日 (日) 12:26 (UTC)
參見Special:用戶貢獻/weiqinghe-bot—— 呆呆|ω・`) 捕捉 | 爪跡 2017年12月31日 (日) 13:02 (UTC)
請在Wikipedia:專題委員會/技術支持提出申請。--Antigng留言2017年12月31日 (日) 13:46 (UTC)