Wikipedia hakwiki https://hak.wikipedia.org/wiki/Th%C3%A8u-Ya%CC%8Dp MediaWiki 1.47.0-wmf.7 first-letter 媒體 特殊 討論 使用者 使用者討論 Wikipedia Wikipedia討論 檔案 檔案討論 MediaWiki MediaWiki討論 模板 模板討論 說明 說明討論 分類 分類討論 TimedText TimedText talk 模組 模組討論 Event Event talk Kóng-thiet CRC-Stock EMU(C6554-07E) tshâ-hin Lie̍t-tshâ 0 3233 134315 133299 2026-06-19T23:58:58Z InternetArchiveBot 28123 Rescuing 2 sources and tagging 0 as dead.) #IABot (v2.0.9.5 134315 wikitext text/x-wiki Kóng-thiet CRC-Stock EMU(C6554-07E) 係 [[Hiông-kóng]] [[Kóng-thiet]] [[Hiông-kóng Thiet-lu Yû-han Kûng-sṳ̂]] == 列車編組 == A351-C351-B351-B851-C851-B352-C352-A352<br> A353-C353-B353-B852-C852-B354-C354-A354<br> A355-C355-B355-B853-C853-B356-C356-A356<br> == 大事年表 == * [[2008年]][[2月11日]]:宣佈計劃招標購入10列新列車。 * [[2008年]][[10月14日]]:批出10列新車合約予[[中國北車集團]][[长春轨道客车|長春軌道客車股份有限公司]],招標編號為C6554-07E,造價總值港幣11.3億元<ref>[http://www.mtr.com.hk/chi/projects/hk_newtrain.html 港鐵公司 - 新支綫及工程項目 - 市區綫新列車採購]</ref>。 * [[2010年]][[12月6日]]:首列列車在長春完成生產和下線。<ref>中國北車股份有限公司 - 集團新聞:[https://web.archive.org/web/20110708144839/http://www.chinacnr.com/272-655-3624.aspx 世界最高標準地鐵車輛在中國北車下線]</ref> * [[2011年]][[4月23日]]:首列列車(A/C/B351/352)在遼寧營口港順利起運。<ref>中國北車股份有限公司 - 集團新聞:[https://web.archive.org/web/20140315103537/http://www.chinacnr.com/272-655-4077.aspx 北車製造首列香港地鐵在遼寧營口港起運]</ref> <!-- 請只寫入列車運抵, 初次試車及投入服務之資訊, 以避免混亂--> * [[2011年]][[4月30日]]:首列列車(A/C/B351/352)運抵小蠔灣車廠。<ref>[http://www.mtr.com.hk/eng/corporate/file_rep/PR-11-035-C.pdf 10列新增港鐵列車首列抵港]港鐵新聞稿,2011年4月30日</ref> * [[2011年]][[7月1日]]:首列列車(A/C/B351/352)從小蠔灣車廠調往九龍灣車廠。 * [[2011年]]下半年:正式投入服務(預期)。 * [[2011年]][[7月22日]]:增購86卡車廂。 * [[2011年]][[8月9日]]:第三列列車(A/C/B355/356)在[[小蠔灣車廠]]試車。 * [[2011年]][[9月18日]]:報章報導,此類列車只會服務[[觀塘綫]]或[[荃灣綫]],而車長需再接受培訓並通過考試,才可駕駛本類型的車輛。<ref name="signtao_0918" /> * [[2011年]][[10月5日]]至[[10月11日|11日]]:列車於晚間非繁忙時間在[[觀塘綫]]進行不載客試車。<ref>[http://www.mtr.com.hk/eng/corporate/file_rep/PR-11-093-C.pdf 新港鐵列車試行]港鐵新聞稿,2011年10月4日</ref> * [[2011年]][[10月11日]],報章再報導此類型列車會率先行駛[[觀塘綫]]<ref name="od_1011">{{cite news|url=http://orientaldaily.on.cc/cnt/news/20111011/00176_049.html|title=港鐵國產列車裝32天眼|date=2011-10-11|accessdate=2011-10-13|newspaper=東方日報}}</ref>。 * [[2011年]][[10月12日]]起:列車於晚間非繁忙時段在[[觀塘綫]]進行「影子測試」({{lang-en|Shadow Running Test}})。<ref>http://www.youtube.com/watch?v=7yGHpgZH44g</ref><ref>http://www.youtube.com/watch?v=2iMz05m0JLE</ref><ref>http://www.youtube.com/watch?v=b27QqLpeLaQ</ref><ref>http://www.youtube.com/watch?v=pyd9pce_Hxk</ref><ref>http://www.youtube.com/watch?v=a5B9NkzT7h0</ref> * [[2011年10月]]:其中一列列車調往[[荃灣車廠]]。 * [[2011年]][[10月27日]]:列車A/C/B359/360調往[[九龍灣車廠]]。 * [[2011年]][[11月3日]]:列車A/C/B361/362在小蠔灣車廠試車。 * [[2011年10月]]底:完成列車與地面信號的聯調試驗。 * [[2011年]][[11月7日]]:列車A/C/B359/360於下午2時37分在[[彩虹站]]發生衝燈事故。<ref>{{cite news|url=http://hk.apple.nextmedia.com/template/apple/art_main.php?iss_id=20111208&sec_id=4104&art_id=15872742|title=試行埋站 訊號系統失靈 國產列車橫衝直撞入彩虹|date=2011-12-08|accessdate=2011-12-10|newspaper=蘋果日報}}</ref> * [[2011年]][[12月7日]]:列車A/C/B359/360於晚上10時半左右正式投入服務,主力行走[[觀塘綫]]。<ref>{{Cite web |title=港鐵中國列車將行走觀塘線 |url=http://hk.news.yahoo.com/%E6%B8%AF%E9%90%B5%E4%B8%AD%E5%9C%8B%E5%88%97%E8%BB%8A%E5%B0%87%E8%A1%8C%E8%B5%B0%E8%A7%80%E5%A1%98%E7%B7%9A-084215846.html |access-date=2012-01-14 |archive-date=2012-01-14 |archive-url=https://web.archive.org/web/20120114092059/http://hk.news.yahoo.com/%E6%B8%AF%E9%90%B5%E4%B8%AD%E5%9C%8B%E5%88%97%E8%BB%8A%E5%B0%87%E8%A1%8C%E8%B5%B0%E8%A7%80%E5%A1%98%E7%B7%9A-084215846.html |dead-url=yes }}</ref> * [[2011年]][[12月9日]]:列車A/C/B359/360於晚上10時40分於[[九龍塘站]]發生故障,車上所有乘客需要下車,列車駛回車廠檢查。<ref>{{cite news|url=http://hk.apple.nextmedia.com/template/apple/art_main.php?iss_id=20111210&sec_id=4104&subsec_id=11867&art_id=15879915|title=國產港鐵列車剛啟用即故障|date=2011-12-10|accessdate=2011-12-10|newspaper=蘋果日報}}</ref><ref>[http://twitter.com/#!/mtrupdate/status/145152139713454081 Twitter - mtrupdate]</ref> * [[2011年]][[12月19日]]:第3編組列車(編號A/C/B 355~356)於晚上10時左右正式投入服務。 * [[2011年]][[12月29日]]:第5編組列車(編號A/C/B 359~360)首次出現於晚上繁忙時間。 ==技術特點== 此列車屬於中國大陸標準A型地鐵車輛,採用輕量化不銹鋼免塗裝鼓型車體,壽命可達40年。列車採用與[[港鐵Rotem電動列車]]相似的牽引、輔助和監控系統,並針對原有車輛的缺點和問題進行改善,而且可與現有類型車輛使用相同零件。針對香港的氣候環境,列車採用大製冷量的單元式空調機組,空調可在室外溫度56℃的情況下全冷運作。另外車上配置實時乘客訊息系統和無線網絡接收系統,而安裝在車內的顯示器據試車時所見將會用作播放「[[新聞直線]]」,但第1卡及第8卡將會設為靜音車廂。 牽引系統採用交流傳動,[[IGBT]][[逆變器|牽引逆變器]]及[[牽引電動機]]均採用[[三菱]]產品。列車採用長客CW6000(D)型無搖枕[[轉向架]],構架為低合金高強度耐候結構鋼鋼板焊接而成。一系懸掛為螺旋彈簧;二系懸掛為[[空氣彈簧]]及垂向油壓減震器。基礎制動採用帶有防滑控制功能的輪盤制動單元;電制動採用[[再生制動]]。轉向架並配備有輪緣潤滑裝置,可以減少車輪的磨耗,降低車輛通過曲線時產生的噪音。 == 大事年表2 == ;列車性能 與[[港鐵Rotem電動列車|韓製列車]]一樣,這款列車比行走東涌綫的[[港鐵Adtranz-CAF電動列車|西班牙製列車]]和行走市區綫的[[港鐵都城嘉慕電動列車 (直流電)|都城嘉慕列車]],有較佳的加速率1.3m/s<sup>2</sup>(4.68km/h/s)([[港鐵都城嘉慕電動列車 (直流電)|英製列車]]、[[港鐵Adtranz-CAF電動列車|西班牙製列車]]為1.0m/s/s,3.6km/h/s)和減速率0.8至1.35m/s<sup>2</sup>(2.88至4.86km/h/s)([[港鐵都城嘉慕電動列車 (直流電)|英製列車]]、[[港鐵Adtranz-CAF電動列車|西班牙製列車]]為1.0m/s/s,3.6km/h/s)。 由於本系列車加速度很高,為了増加安全,列車自動控制程式與千九列車一樣,加速時首兩秒加速度較慢,之後明顯提高加速度<ref>http://www.youtube.com/watch?v=fWVfi9pAh_4#t=47s</ref>。 ;車門特點 本列車車門與[[都城嘉慕電動列車_(直流電)|都城嘉慕列車]]及[[港鐵近畿川崎電動列車|千九列車]](SP1900/1950型電動列車,下稱千九列車)都是「滑動式車門」,車門由[[法國]]的Faiveley提供(與千九列車相同);而非[[港鐵Rotem電動列車|韓製列車]]般的「[[內崁式門|嵌入式車門]]」,但隔音效果比[[都城嘉慕電動列車 (直流電)|都城嘉慕列車]]良好。所有車門裝有手握。 另外,車門設有獨立重開功能,如夾物會自動且獨立重開車門(及有關的月台幕門,如果幕門同時夾物的話)至特定闊度(該闊度足以讓有關物件或乘客鬆開),並自動關上,未有夾物的車門則不會重開,設計與[[SP1900/1950型電動列車|千九列車]]類似<ref name="mtrupdate_feature">[http://twitter.com/#!/mtrupdate/status/144124379691892737 MTR Service Update] - 2011年12月7日</ref>;此功能限使用三次,三次之後如列車車門仍不能正常關上,車長則必須開啟全部車門,重新關閉。所有車門關上後,顯示落車方向的提示燈才會熄滅。 ;扶手 [[File:弧形扶手.JPG|thumb|弧形扶手]] 本列車採用弧形扶手,港鐵公司指可以令車廂感覺更寬闊<ref>{{cite news|title=港鐵國產列車裝32天眼|url=http://orientaldaily.on.cc/cnt/news/20111011/00176_049.html?pubdate=20111011|accessdate=2012-02-05|newspaper=東方日報|date=2011-10-11}}</ref>。 ;車頭緊急出口 [[File:MTR CRC Train Emergency Exit.jpg|thumb|首4列的緊急逃生出口(圖中),可見緊急門向右滑出]] [[File:緊急出口的打開方法.JPG|thumb|經改裝後的開門方式]] 本列車首4列出廠的緊急出口門之開啟方式與第5列起的開啟方式,曾有所不同。 首4列(由A351至A358)原先的設計中,乘客開啟時需先拉下門鎖把手,門即會向右滑出,之後再等待指示燈亮起,便可拉下斜道把手,斜道伸出,此時可步出離開<ref>[https://web.archive.org/web/20160304113057/http://www.railgallery.info/photo_showcase/d/12467-4/RailGallery_230910_270.jpg A351至A356車門開啟指示圖] - RailGallary</ref>。 但由第5列起,設計被更改,新的設計中乘客需拉下門掣,然後人手向外推開車門,之後無需等待指示燈,即可拉下斜道把手,斜道伸出,此時踏下腳板,便可步出離開。此設計中,緊急出口門不再向右滑出<ref>[http://www.mtr.com.hk/chi/publications/images/safetybooklet.pdf 安安全全搭港鐵] - 港鐵公司</ref>,最後首4列也被改為第5列的設計。 ; 節省電力 本列車採用[[IGBT]] [[VVVF]]及[[回生制動]],用電量與[[港鐵Rotem電動列車|韓製列車]]相若,與使用[[可關斷晶閘管]](GTO)的[[港鐵都城嘉慕電動列車 (直流電)|都城嘉慕列車]]比較,用電量明顯較少。 ===市區綫=== 市區綫列車與其他行走市區綫列車相近,並參考了韓製列車及英製列車的設計,針對缺點作出改良。 ===南港島綫=== 南港島綫列車與市區綫列車相近,由於南區與海洋息息相關,列車將以「沿海之鄉」為設計主題,交由法國MBD設計事務所設計,規格則與市區線列車相若。列車闊度約2.8米、高約2米,每列車有3卡。<ref>{{cite web|author=港鐵公司|title=南區區議會 交通及運輸事務委員會 南港島綫(東段)新列車 - 補充文件|url=http://www.districtcouncils.gov.hk/south/doc/common/committee_meetings_doc/TTC/02/TTC_2012_13_TC_Supplementary.pdf|accessdate=2012-08-27|month=4|year=2012|archive-date=2014-03-14|archive-url=https://web.archive.org/web/20140314132127/http://www.districtcouncils.gov.hk/south/doc/common/committee_meetings_doc/TTC/02/TTC_2012_13_TC_Supplementary.pdf|dead-url=yes}}</ref> ;車外 車身將以白色為主色,並利用視覺效果將車門及車窗連成一體化之形態。車頂將有紅色條子,但與現時市區綫中國製列車中間的紅色線條有所分別。車頭則將會採用流線型設計的線條,車頭燈則採用不規則的圖案設計。 ;車內 * 多用途空間:第一、三卡將設有1個多用途空間,第二卡將設有3個多用途空間;第一、三卡將設有45個座位,第二卡則為39個。多用途空間將設有扶手,但不會設有半座位。<ref>[http://www.chinanews.com/ga/2013/03-28/4685674.shtml 中国首列无人驾驶地铁年内下线 将在香港运营]</ref> * 吊環:列車的吊環將採用軟物料製造,並採用人體工學設計。為使更多乘客能夠使用吊環,吊環將分為兩行,類似[[港鐵近畿川崎電動列車|近畿川崎列車]]的設計。 * 燈光:座椅下會設劇院式燈光較果。 * 電視機:車廂會設有四個電視機,為乘客提供影音資訊,亦設有靜音車廂。 * 扶手:列車靠近車門位置的扶手會一開三,方便乘客緊握扶手。 ;無人駕駛 據港鐵公佈,[[南港島綫]](東段)將會採用無人駕駛的列車,並配置全自動駕駛系統,不會有車長駕駛,但會派職員在列車上監視列車,以確保如有故障,例如控制室未能控制列車,可以人手駕駛。<ref name=etnet_sil>{{cite news|title=港鐵(66):南港島線東段料2015年竣工,引入無人駕駛列車|url=http://www.etnet.com.hk/www/tc/news/categorized_news_detail.php?category=company&newsid=ETN220416469|accessdate=2012-04-16|newspaper=經濟通|date=2012-04-16}}</ref> <ref name=mingpao_sil>{{cite news|title=港鐵南港島線列車有3卡車|url=http://inews.mingpao.com/htm/Inews/20120416/gb11647a.htm|accessdate=2012-04-16|newspaper=明報|date=2012-04-16|archive-date=2012-07-11|archive-url=https://web.archive.org/web/20120711125702/http://inews.mingpao.com/htm/INews/20120416/gb11647a.htm|dead-url=yes}}</ref> <ref name=apple_sil>{{cite news|title=南港島線用無人系統 列車由法國設計公司進行內部設計中國北車長客外部設計及技術製造|url=http://hk.apple.nextmedia.com/realtime/art_main.php?iss_id=20120416&sec_id=6996647&art_id=50081396|accessdate=2012-04-16|newspaper=蘋果日報|date=2012-04-16}}</ref>港鐵稱,此舉能夠令系統可靠率更高、列車更靈活調動,而車上的職員亦能更靈活及更直接的照顧乘客需要<ref>{{cite web|author=港鐵公司|title=主要資料 / 新列車設計|url=http://www.mtr-southislandline.hk/tc/key-information/new-train.html|accessdate=2012-08-27|archive-date=2016-03-04|archive-url=https://web.archive.org/web/20160304205141/http://www.mtr-southislandline.hk/tc/key-information/new-train.html|dead-url=yes}}</ref>。 == 設備 == <!--A371-A372車卡連接位冇紅色鐵鏈 http://www.youtube.com/watch?v=TBqyTZkfKN4--> [[File:C-Train多用途空間.JPG|thumb|不設緊急通風窗的位置及設有半座位的多用途空間,已被拆除]] [[File:閉路電視.JPG|thumb|閉路電視]] 本列車車上配有以下設備,供乘客使用: * 緊急通風窗:每列市區綫中國製列車的第1、2、7、8卡,所有車窗均設有緊急通風窗;第3至6卡,除多用途空間的車窗外,其餘均設有緊急通風窗。第4列列車(A/C/B 357/358)的第2至7卡則有1個窗沒有通風窗;第3列列車(A/C/B 355/356)及由第5列列車(A/C/B 359/360)起­,第2至7卡各有2個窗沒有通風窗­,而所有A卡則有1個車窗沒有通風窗。 * 半座位:第3列列車(A/C/B 355/356)及第5列列車(A/C/B 359/360)投入服務初期在中間4卡設有兩個大型多用途空間,其餘車廂均設有一個小型多用途空間,多用途空間原設有半座位,有關列車已經分別於2012年12月及2013年4月拆除,並與其他編組統一多用途空間編排。 * 緊急通話器:每卡車廂均梅花間竹式在A及B面車門設置共5個緊急通話器,如有危急事故,乘客可以拉上保護蓋,拉下手掣來直接與車長談話,車長將獨立回應。 * 滅火器:設於車卡交接位,如有火警可於職員指示下使用。 * 閉路電視:本列車與[[SP1900/1950型電動列車|千九列車]]一樣,車上都裝有閉路電視,車長可在乘客按動緊急通話掣後,查看閉路電視以了解車廂情況<ref name="mtrupdate_feature" />。閉路電視錄影帶會保留5日。<ref name="pcpd_cctv_report">{{cite web|title=香港鐵路有限公司閉路電視系統 視察報告|url=http://www.pcpd.org.hk/chinese/publications/files/R13_2768_c.pdf|accessdate=2013-07-31|pages=25|language=zh-hk|format=PDF|date=2013-04-09}}</ref> * 緊急出口:設於兩邊駕駛室內。乘客拉下門掣後,需用人手向外推開車門,並拉下斜道把手,斜道伸出,此時踏下腳板,便可步出離開車廂。參見本文[[#特點|特點]]一章。 == 編組 == ===市區綫=== {|width=auto align=center style="border:1px solid #999;text-align:center" |-bgcolor=#c0c0f0 !rowspan="2"| 批次 !rowspan="2"| 批出合約時間 !rowspan="2"| 列車數量 !rowspan="2"| 車卡編號 !colspan="3"| 車卡數量 !rowspan="2"| 投入服務日期 |-bgcolor=#c0c0f0 | A || B || C |- !首批訂購列車 |2008年10月14日 |15列 |A/C/B351-380、B/C851-865 |30 || 45 || 45 |2011年12月7日至2012年12月28日 |- !第二批訂購列車 |2011年7月22日 |7列<small>(不包括南港島綫列車)</small> |A/C/B381-394、B/C866-872 |14 || 21 || 21 |2013年1月31日至9月8日 |- |bgcolor=#c0c0f0 colspan=4| 總數 |44 || 66 || 66 |} 列車以8卡為一列,編組方式為A-C-B-B-C-B-C-A。由於當中A-C-B(或B-C-A)為一組,B-C亦為一組;調卡時,都會整組調走,但本系列車尚未有任何調卡情況。 {|width=70% align=center style="border:1px solid #ccf; text-align:center" |- !bgcolor="white" colspan=10|[[觀塘綫]]車卡組合註解 |- !bgcolor=#c0c0f0|車廂 !bgcolor=#c0c0f0|[[電力機車|駕駛室]] !bgcolor=#c0c0f0|[[電動機]] !bgcolor=#c0c0f0|[[集電弓]] !bgcolor=#c0c0f0|自動<br />聯結器 !bgcolor=#c0c0f0|長度(毫米) !bgcolor=#c0c0f0|座位 !bgcolor=#c0c0f0|[[輪椅]]預留位<br/><small>(即三個座位的大小)</small> !bgcolor=#c0c0f0|數量 |- !align=right|A駕駛室拖卡 |'''<span style="color:red;">O</span>'''||<small style="color:silver;">X</small>||<small style="color:silver;">X</small>||'''<span style="color:red;">O</span>''' |23090||45||1||28 |- !align=right|B動力車廂 |<small style="color:silver;">X</small>||'''<span style="color:red;">O</span>'''||<small style="color:silver;">X</small>||<small style="color:silver;">X</small> |21600||39||3||42 |- !align=right|C集電弓電力車廂 |<small style="color:silver;">X</small>||'''<span style="color:red;">O</span>'''||'''<span style="color:red;">O</span>'''||'''<span style="color:red;">O</span>''' |21600||39||3||42 |- |} {|align=center style="background-color:#fff;border:1px solid #999;max-width:750px;" |- |style="font-size: 80%;" width="25%" valign=top align=left|'''下行'''''(往[[油麻地站|油麻地]])'' |width=50% valign=top align=center|[[觀塘綫]]的組合(22列) |style="font-size: 80%;" width="25%" valign=top align=right|''(往[[調景嶺站|調景嶺]])'''''上行''' == 列車問題 == [[File:MTR CRC Train Emergency Exit.jpg|thumb|北車長客電動列車的緊急逃生出口(圖中)]] 有[[港鐵]]員工指出,在此類型列車運到香港時,上司要求各人驗車要較平常程序更嚴格,因為該車來自工業質量劣評多多的[[中國大陸]]。驗車後,發現車廂座位櫈邊鑲嵌高低不平;亦發現部分車轆行駛時有火花,可能會煞掣失靈並引致重大事故;另外,更發現此類列車有車門關上後,黑膠邊懷疑「啜實」車門過緊,無法再自動開啟,要由人手開門,亦有列車在斜路或彎位路軌行走時,車門無法開啟。不過,此類列車與現有之技術協調未有任何問題。<ref name="signtao_0918">{{cite news|title=港鐵國產列車疑爆安全問題|url=http://news.sina.com.hk/news/2/1/1/2438722/1.html|accessdate=2011-10-01|newspaper=星島日報|date=2011-09-18|language=zh-hk}}</ref></br> 有報章報導,港鐵密件揭露一列代號「5號」(列車編號A/C/B359/360)的國產列車,11月初在[[彩虹站]]以自動模式試行時,因訊號系統失靈,埋站時未能按路軌訊號燈指示煞停,司機即時啟動緊急煞車掣,列車最後「衝過龍」約13米,未釀嚴重事故。港鐵證實事件,指事故後已作出修正。<ref>http://hk.apple.nextmedia.com/template/apple/art_main.php?iss_id=20111208&sec_id=4104&art_id=15872742 試行埋站 訊號系統失靈 國產列車橫衝直撞入彩虹</ref> === 安全 === 有[[港鐵]]員工指出,因為港鐵首次購入在製造商品“劣評多多”的[[中國大陸]]製造的列車,所以本批次列車運到香港后,上司要求員工驗車時要較平常程序更嚴格。而驗車後發現車廂座位櫈邊鑲嵌高低不平;以及部分車轆行駛時會產生火花,可能會煞掣失靈並引致重大意外。另外,更發現本批次列車有車門關上後,[[門膠]]會吸在一起,令車門過緊而無法再自動開啟,需要由人手開門。亦有指本批次列車在斜路或彎位路軌行走時車門同樣無法開啟。同時網上有相片指出,有其中一列列車(第一編組)被調動至[[荃灣車廠]],所有車門被拆下,方便進行重裝地板工程<ref>{{cite news|author=Kapok|title=731.jpg|url=http://img.photobucket.com/albums/v140/s3m44/post/731.jpg|accessdate=2012-05-01}}</ref><ref>http://www.facebook.com/photo.php?fbid=3464980190458&set=o.108641472564845&type=1</ref>。現時,有關列車已經投入服務。 不過,有部分問題也曾於[[港鐵Rotem電動列車|韓製列車]]投入服務初期出現過,而本批次列車與現有之信號和程式等技術協調未有任何問題<ref name="signtao_0918"/>。 === 訊號系統 === 有報章報導,港鐵密件揭露一列代號「5號」(即第5編組,編號A/C/B 359~360)的中國製列車,[[2011年]]11月初在[[彩虹站]]以自動模式(即以[[ATO]]運作)試行時,因訊號系統失靈,埋站時未能按路軌訊號燈指示煞停,司機即時啟動緊急煞車掣,列車最後過站約13米,並未釀嚴重事故。港鐵證實事件,指事故後已作出修正<ref name="CHH_overrun" />。 === 車廂與地台水平的偏差 === 2011年12月9日晚上10時40分,第五編組(A/C/B 359~360)之中國製列車駛至[[九龍塘站]]時,車長發現車廂地台水平與月台水平出現偏差,車廂地台較高。為安全起見,港鐵於同日晚上將列車駛回車廠進行詳細檢查<ref> [http://hk.apple.nextmedia.com/template/apple/art_main.php?iss_id=20111210&sec_id=4104&subsec_id=11867&art_id=15879915 國產港鐵列車剛啟用即故障] 蘋果日報. 2011年12月10日</ref>。 === 無法對準於月台停車位 === {{multiple image | align = right | direction = vertical | width = 220 | image1 = PSD與C-Train車門的誤差.JPG | caption1 = | image2 = HK C-Train EMU Door Error@WMT.JPG | caption2 = 月台幕門與列車位置有所偏差 }} 有報章報導,多列中國製列車車門經常無法對準月台停車位,使車門被幕門遮擋,并須作人手調整。当中大部分车站在停站後均有偏差,最嚴重是出入通道被幕門遮擋近一呎,妨礙乘客上下車。而报道称其中一列由油麻地駛往調景嶺的列車,更有三個車站出現嚴重偏差,需要由車長以人手調整列車停車位置,乘客才能上落。 然而有部分时候,港铁线路因信号和程式问题,英製列車和韓製列車同样会出现与站台有偏差的情况,但由於所有幕門是以英製列車和韓製列車的長度設計,兩系列車之長度均與中國製列車不相同(英製列車全長180020mm,韓製列車全長183000mm,中國製列車全長175780mm,較其他列車短),而韓製列車與中國製列車的車門闊度較英製列車的窄,但韓製列車的偏差遠較中國製列車為低,因此中国制列车会比英製列車和韓製列車的偏差的偏差大<!--港鐵行ATO的,車長無法決定 ,現時車長只能依靠本身的經驗對準月台幕門,務求列車對準以減少偏差-->。除了偏差问题外,據港鐵知情人士透露,港鐵至今仍未能解決列车到站时与月台偏差的程式問題,<ref name="appledaily_0502">[http://hk.apple.nextmedia.com/news/art/20120502/16300482 國產列車埋站唔啱位 港鐵未解決控制程式 礙乘客上落]蘋果日報. 2012年5月2日</ref>。 === 耗電量高 === 有港鐵内部人士透露,列車耗電量超出預期,同一方向的行車線上,最多只能安排兩列中國製列車同時行駛<ref name="appledaily_0502" />,主要在中午及下午繁忙時段行走觀塘線。不過,目前在繁忙時段有接近9-15列中國製列車同時行駛,乘客搭到的機會相當高,亦表示電力問題已經修復;在2013年7月27日及9月1日更曾出現單一方向最高連續12班列車為中國製列車的記錄,有可能是為了測試大量中國製列車在完全無英製列車分隔下連續班次行走的穩定性。 === 廣播喇叭 === {{Unreferenced section}} {{Fact|有部分乘客表示,當列車內的廣播喇叭在進行廣播時,會發出高頻的聲音。第13列及之後的列車於投入服務時,廣播已經沒有發出高頻聲音。之前投入服務的列車,大部份亦已完成修正此問題。目前,廣播時將不會再發出高頻廣播聲音。 另外,有部份列車新聞直線節目播放時,畫面與聲音不同步。|來源請求}} === 其他 === 2012年1月28日下午1時許,觀塘綫一列駛往油麻地的中國製列車,駛至[[彩虹站]]時,車長突然發現列車所接收的訊號不暢順,讓車上所有乘客下車,駛返車廠檢驗<ref> [http://orientaldaily.on.cc/cnt/news/20120129/00176_037.html 港鐵國產列車壞完又壞] 東方日報. 2012年1月29日</ref>。 2013年5月14日中午12時,有乘客在調景嶺站登上第19編組列車(編號A/C/B 387~388),在列車卡與卡之間的通道發現有一扇遮蓋門無故打開,露出列車接合扣位,並不斷搖晃,列車駛至九龍灣站時有職員上車留守至油麻地站,再交由技術人員處理。經初步調查,相信該列車遮蓋在出廠時,其門鎖未有鎖緊至意外鬆開<ref> [http://hk.apple.nextmedia.com/realtime/news/20130514/51407927 港鐵國產列車遮蓋打開 接口位任睇] 蘋果日報. 2013年5月14日</ref>。 === 列車歷史 === {| class="wikitable" ! rowspan="2"| 列車編組 ! rowspan="2"| 運送抵港 ! rowspan="2"| 試車開始 |- ! 首次晚間營運 ! 首次日間營運 ! 首次繁忙時間營運 |- ! colspan="7" class="mw-customtoggle-1" | 市區綫第一批列車 (10列) |-id="mw-customcollapsible-1" class="mw-collapsible" | A351/A352(第1列列車)|| 2011年4月30日<ref name="20110430_arrive">{{cite news|author=港鐵公司|title=10 列新增港鐵列車首列抵港|url=http://www.mtr.com.hk/eng/corporate/file_rep/PR-11-035-C.pdf|accessdate=2011-12-30|date=2011-04-30}}</ref> || 2011年10月5日(試車)<ref name="20111005_trial_run">{{cite news|author=港鐵公司|title=新港鐵列車試行|url=http://www.mtr.com.hk/eng/corporate/file_rep/PR-11-093-C.pdf|accessdate=2011-12-30|date=2011-10-04}}</ref> <br/>2011年10月12日(影子測試)<br/>2012年1月30日(將軍澳線上試車)<br/>2012年5月31日(再次影子測試)|| 2012年6月29日 || 2012年7月9日 || 2012年7月16日(傍晚)<br>2012年7月25日(上午) |-id="mw-customcollapsible-1" class="mw-collapsible" | A353/A354(第2列列車)|| 2011年5月18日 || 2011年11月28日<br>2012年4月17日<br/>2012年12月28日(將軍澳線影子測試) || 2012年4月30日 || 2012年5月12日 || 2012年5月21日(傍晚)<br>2012年5月29日(上午) |-id="mw-customcollapsible-1" class="mw-collapsible" | A355/A356(第3列列車)|| 2011年7月7日 || 2011年8月9日 || 2011年12月19日(觀塘綫)<br>2013年5月15日(將軍澳綫) || 2012年1月7日 || 2012年1月16日 |-id="mw-customcollapsible-1" class="mw-collapsible" | A357/A358(第4列列車)|| 2012年4月 || 2012年5月18日(影子測試)<br>2013年8月27日(港島綫上試車) || 2012年5月31日|| 2012年6月7日 || 2012年6月14日(傍晚)<br>2012年6月25日(上午) |-id="mw-customcollapsible-1" class="mw-collapsible" | A359/A360(第5列列車)|| 2011年8月2日 || 2011年8月9日(車廠內)<br/>2011年10月31日(影子測試) || 2011年12月7日<ref>{{cite news|author=港鐵公司|title=新港鐵列車十二月七日正式投入服務|url=http://www.mtr.com.hk/eng/corporate/file_rep/PR-11-108-C.pdf|accessdate=2011-12-30|date=2011-12-06}}</ref> || 2011年12月16日 || 2011年12月29日(傍晚)<br>2012年1月16日(上午) |-id="mw-customcollapsible-1" class="mw-collapsible" | A361/A362(第6列列車)|| {{?}} || 2011年11月3日(車廠內)<br/>2011年12月7日 || 2012年1月7日(觀塘綫)<br>2012年5月29日(荃灣綫) || 2012年1月15日 || 2012年2月23日(傍晚)<br>2012年3月6日(上午) |-id="mw-customcollapsible-1" class="mw-collapsible" | A363/A364(第7列列車)|| {{?}} || {{?}}(觀塘綫影子測試) <br/>2013年6月13日(荃灣綫影子測試) || 2012年1月28日(觀塘綫) <br>2013年5月13日(將軍澳綫) <br>2013年5月16日(康城站)|| 2012年2月4日|| 2012年2月13日(傍晚)<br>2012年2月24日(上午) |-id="mw-customcollapsible-1" class="mw-collapsible" | A365/A366(第8列列車)|| {{?}} || 2012年2月15日 || 2012年2月27日 || 2012年3月5日 || 2012年3月12日(傍晚)<br>2012年3月21日(上午) |-id="mw-customcollapsible-1" class="mw-collapsible" | A367/A368(第9列列車)|| 2012年3月 || 2012年7月3日(影子測試) || 2012年7月20日 || 2012年7月27日 || 2012年8月3日(傍晚)<br>2012年8月13日(上午) |-id="mw-customcollapsible-1" class="mw-collapsible" | A369/A370(第10列列車)|| 2012年5月22日 || 2012年6月26日(車廠內)<br/> 2012年7月29日(影子測試)|| 2012年8月4日 || 2012年8月15日 || 2012年8月21日(傍晚)<br>2012年8月28日(上午) |-id="mw-customcollapsible-1" ! colspan="7" class="mw-customtoggle-1" | 市區綫第一批列車(增訂) (5列) |-id="mw-customcollapsible-1" class="mw-collapsible" | A371/A372(第11列列車)|| 2012年7月31日 || 2012年8月12日(觀塘線上試車)<br/> 2012年8月27日(觀塘綫影子測試)<br/> 2012年11月22日(將軍澳線影子測試)|| 2012年9月10日 || 2012年9月18日 || 2012年9月24日(傍晚)<br>2012年10月3日(上午) |-id="mw-customcollapsible-1" class="mw-collapsible" | A373/A374(第12列列車)|| 2012年7月24日<ref>http://farm8.staticflickr.com/7259/7636816984_bf50d6baeb_c.jpg</ref> || 2012年9月25日(觀塘綫影子測試)<br/>2012年11月23日(將軍澳線影子測試) || 2012年10月3日 || 2012年10月11日 || 2012年10月12日(傍晚)<br>2012年10月15日(上午) |-id="mw-customcollapsible-1" class="mw-collapsible" | A375/A376(第13列列車)|| 2012年9月6日 || 2012年10月10日(車廠內)<br/> 2012年11月4日(影子測試) || 2012年11月17日 || 2012年11月18日 || 2012年11月21日(傍晚)<br>2012年11月26日(上午) |-id="mw-customcollapsible-1" class="mw-collapsible" | A377/A378(第14列列車)|| {{?}} || 2012年10月6日(車廠內) || 2012年12月5日 || 2012年12月7日 || 2012年12月11日(傍晚)<br>2012年12月14日(上午) |-id="mw-customcollapsible-1" class="mw-collapsible" | A379/A380(第15列列車)|| {{?}} || 2012年12月12日(影子測試)<br>2013年7月10日(港島線上試車) || 2012年12月28日 || 2013年1月1日 || 2013年1月4日(傍晚)<br>2013年1月10日(上午) |- ! colspan="7" class="mw-customtoggle-2" | 市區綫第二批列車 (7列) |-id="mw-customcollapsible-2" class="mw-collapsible" | A381/A382(第16列列車)|| 2012年11月29日 ||2013年1月22日(影子測試) || 2013年1月31日 || 2013年2月4日 || 2013年2月14日(傍晚)<br>2013年2月18日(上午) |-id="mw-customcollapsible-2" class="mw-collapsible" | A383/A384(第17列列車)|| 2012年12月27日 || 2013年2月17日(車廠內)<br/> 2013年3月7日(影子測試) || 2013年3月19日 || 2013年3月22日 || 2013年3月25日(傍晚)<br>2013年3月28日(上午) |-id="mw-customcollapsible-2" class="mw-collapsible" | A385/A386(第18列列車)|| 2013年1月8日 ||2013年3月21日(影子測試) || 2013年4月8日 || 2013年4月11日 || 2013年4月15日(傍晚)<br>2013年4月17日(上午) |-id="mw-customcollapsible-2" class="mw-collapsible" | A387/A388(第19列列車)|| 2013年2月 || 2013年4月14日(觀塘線上試車)<br/> 2013年4月18日(影子測試)|| 2013年5月8日 || 2013年5月12日 || 2013年5月14日(傍晚)<br>2013年5月20日(上午) |-id="mw-customcollapsible-2" class="mw-collapsible" | A389/A390(第20列列車)||2013年3月12日 || 2013年5月22日(影子測試) || 2013年6月8日 || 2013年6月11日 || 2013年6月13日(傍晚)<br>2013年6月18日(上午) |-id="mw-customcollapsible-2" class="mw-collapsible" | A391/A392(第21列列車)|| 2013年5月 || 2013年7月4日(影子測試) || 2013年8月8日 || 2013年8月11日 || 2013年8月14日(傍晚)<br>2013年8月19日(上午) |-id="mw-customcollapsible-2" class="mw-collapsible" | A393/A394(第22列列車)|| 2013年7月 || 2013年8月28日(影子測試) || 2013年9月8日 || 2013年9月11日 || 2013年9月13日(傍晚)<br>2013年9月18日(上午) |} 註:「{{?}}」表示有關日期不詳。 == 圖片集 == <gallery> File:C-Train (MTR).jpg|影子測試,車序098 File:C-Train at Kowloon Bay.JPG|第3編組列車(編號A/C/B 355~356)前往調景嶺 File:A365-A366 at KOB.JPG|第8編組列車(編號A/C/B 365~366)前往調景嶺 File:C-Train手動開門裝置.JPG|手動開門裝置(只供職員使用) File:HK C-Train EMU Door Error@WMT.JPG|[[月台幕門]]與C-Train車門的偏差(攝於油麻地站月台) File:C-Train的座位.JPG|座位 File:C-Train獨家之小心碰頭.JPG|車卡連接位之小心碰頭貼紙 File:C-Train優先座.JPG|優先座 File:沒有廣告的廣告位.JPG|廣告位置 File:C-Train車廂交接位.JPG|車卡連接位 File:MTR URL C-Train Newsline Express.jpg|列車上的液晶顯示器 </gallery> == 參考資料及注釋 == {{reflist|2}} == 參見 == {{commonscat|C-stocks (MTR)}} * [[港鐵都城嘉慕電動列車 (直流電)]](英製列車) * [[港鐵Rotem電動列車]](韓製列車) * [[都城嘉慕電動列車 (直流電)]] * [[港鐵Rotem電動列車]] == 參考資料及注釋 == {{reflist|2}} ==外部連結== *[https://web.archive.org/web/20120911170023/http://a.imageshack.us/img192/7863/ddss.png 港鐵北車長客電動列車外貌] *[https://web.archive.org/web/20120911170106/http://a.imageshack.us/img834/9572/slas.png 港鐵北車長客電動列車車頭] {{港鐵客運列車}} [[Category:Hiông-kóng Thiet-lu Yû-han Kûng-sṳ̂]] [[Category:Kóng-thiet]] [[Category:Hiông-kóng]] 7rydt2jqtyflli1q5duot3pywm7ynse 模組:String2 828 24302 134316 129347 2026-06-20T01:41:24Z Uzume 2891 Update from [[d:Special:GoToLinkedPage/enwiki/Q16914835|master]] using [[mw:Synchronizer| #Synchronizer]] 134316 Scribunto text/plain require ('strict'); local p = {} p.trim = function(frame) return mw.text.trim(frame.args[1] or "") end p.sentence = function (frame) -- {{lc:}} is strip-marker safe, string.lower is not. frame.args[1] = frame:callParserFunction('lc', frame.args[1]) return p.ucfirst(frame) end p.ucfirst = function (frame) local s = frame.args[1]; if not s or '' == s or s:match ('^%s+$') then -- when <s> is nil, empty, or only whitespace return s; -- abandon because nothing to do end s = mw.text.trim( frame.args[1] or "" ) local s1 = "" local prefix_patterns_t = { -- sequence of prefix patterns '^\127[^\127]*UNIQ%-%-%a+%-%x+%-QINU[^\127]*\127', -- stripmarker '^([%*;:#]+)', -- various list markup '^(\'\'\'*)', -- bold / italic markup '^(%b<>)', -- html-like tags because some templates render these '^(&%a+;)', -- html character entities because some templates render these '^(&#%d+;)', -- html numeric (decimal) entities because some templates render these '^(&#x%x+;)', -- html numeric (hexadecimal) entities because some templates render these '^(%s+)', -- any whitespace characters '^([%(%)%-%+%?%.%%!~!@%$%^&_={}/`,‘’„“”ʻ|\"\'\\]+)', -- miscellaneous punctuation } local prefixes_t = {}; -- list, bold/italic, and html-like markup, & whitespace saved here local function prefix_strip (s) -- local function to strip prefixes from <s> for _, pattern in ipairs (prefix_patterns_t) do -- spin through <prefix_patterns_t> if s:match (pattern) then -- when there is a match local prefix = s:match (pattern); -- get a copy of the matched prefix table.insert (prefixes_t, prefix); -- save it s = s:sub (prefix:len() + 1); -- remove the prefix from <s> return s, true; -- return <s> without prefix and flag; force restart at top of sequence because misc punct removal can break stripmarker end end return s; -- no prefix found; return <s> with nil flag end local prefix_removed; -- flag; boolean true as long as prefix_strip() finds and removes a prefix repeat -- one by one remove list, bold/italic, html-like markup, whitespace, etc from start of <s> s, prefix_removed = prefix_strip (s); until (not prefix_removed); -- until <prefix_removed> is nil s1 = table.concat (prefixes_t); -- recreate the prefix string for later reattachment local first_text = mw.ustring.match (s, '^%[%[[^%]]+%]%]'); -- extract wikilink at start of string if present; TODO: this can be string.match()? local upcased; if first_text then if first_text:match ('^%[%[[^|]+|[^%]]+%]%]') then -- if <first_text> is a piped link upcased = mw.ustring.match (s, '^%[%[[^|]+|%W*(%w)'); -- get first letter character upcased = mw.ustring.upper (upcased); -- upcase first letter character s = mw.ustring.gsub (s, '^(%[%[[^|]+|%W*)%w', '%1' .. upcased); -- replace else -- here when <first_text> is a wikilink but not a piped link upcased = mw.ustring.match (s, '^%[%[%W*%w'); -- get '[[' and first letter upcased = mw.ustring.upper (upcased); -- upcase first letter character s = mw.ustring.gsub (s, '^%[%[%W*%w', upcased); -- replace; no capture needed here end elseif s:match ('^%[%S+%s+[^%]]+%]') then -- if <s> is a ext link of some sort; must have label text upcased = mw.ustring.match (s, '^%[%S+%s+%W*(%w)'); -- get first letter character upcased = mw.ustring.upper (upcased); -- upcase first letter character s = mw.ustring.gsub (s, '^(%[%S+%s+%W*)%w', '%1' .. upcased); -- replace elseif s:match ('^%[%S+%s*%]') then -- if <s> is a ext link without label text; nothing to do return s1 .. s; -- reattach prefix string (if present) and done else -- <s> is not a wikilink or ext link; assume plain text upcased = mw.ustring.match (s, '^%W*%w'); -- get the first letter character upcased = mw.ustring.upper (upcased); -- upcase first letter character s = mw.ustring.gsub (s, '^%W*%w', upcased); -- replace; no capture needed here end return s1 .. s; -- reattach prefix string (if present) and done end p.title = function (frame) -- http://grammar.yourdictionary.com/capitalization/rules-for-capitalization-in-titles.html -- recommended by The U.S. Government Printing Office Style Manual: -- "Capitalize all words in titles of publications and documents, -- except a, an, the, at, by, for, in, of, on, to, up, and, as, but, or, and nor." local alwayslower = {['a'] = 1, ['an'] = 1, ['the'] = 1, ['and'] = 1, ['but'] = 1, ['or'] = 1, ['for'] = 1, ['nor'] = 1, ['on'] = 1, ['in'] = 1, ['at'] = 1, ['to'] = 1, ['from'] = 1, ['by'] = 1, ['of'] = 1, ['up'] = 1 } local res = '' local s = mw.text.trim( frame.args[1] or "" ) local words = mw.text.split( s, " ") for i, s in ipairs(words) do -- {{lc:}} is strip-marker safe, string.lower is not. s = frame:callParserFunction('lc', s) if i == 1 or alwayslower[s] ~= 1 then s = mw.getContentLanguage():ucfirst(s) end words[i] = s end return table.concat(words, " ") end -- findlast finds the last item in a list -- the first unnamed parameter is the list -- the second, optional unnamed parameter is the list separator (default = comma space) -- returns the whole list if separator not found p.findlast = function(frame) local s = mw.text.trim( frame.args[1] or "" ) local sep = frame.args[2] or "" if sep == "" then sep = ", " end local pattern = ".*" .. sep .. "(.*)" local a, b, last = s:find(pattern) if a then return last else return s end end -- stripZeros finds the first number and strips leading zeros (apart from units) -- e.g "0940" -> "940"; "Year: 0023" -> "Year: 23"; "00.12" -> "0.12" p.stripZeros = function(frame) local s = mw.text.trim(frame.args[1] or "") local n = tonumber( string.match( s, "%d+" ) ) or "" s = string.gsub( s, "%d+", n, 1 ) return s end -- nowiki ensures that a string of text is treated by the MediaWiki software as just a string -- it takes an unnamed parameter and trims whitespace, then removes any wikicode p.nowiki = function(frame) local str = mw.text.trim(frame.args[1] or "") return mw.text.nowiki(str) end -- split splits text at boundaries specified by separator -- and returns the chunk for the index idx (starting at 1) -- #invoke:String2 |split |text |separator |index |true/false -- #invoke:String2 |split |txt=text |sep=separator |idx=index |plain=true/false -- if plain is false/no/0 then separator is treated as a Lua pattern - defaults to plain=true p.split = function(frame) local args = frame.args if not(args[1] or args.txt) then args = frame:getParent().args end local txt = args[1] or args.txt or "" if txt == "" then return nil end local sep = (args[2] or args.sep or ""):gsub('"', '') local idx = tonumber(args[3] or args.idx) or 1 local plain = (args[4] or args.plain or "true"):sub(1,1) plain = (plain ~= "f" and plain ~= "n" and plain ~= "0") local splittbl = mw.text.split( txt, sep, plain ) if idx < 0 then idx = #splittbl + idx + 1 end return splittbl[idx] end -- val2percent scans through a string, passed as either the first unnamed parameter or |txt= -- it converts each number it finds into a percentage and returns the resultant string. p.val2percent = function(frame) local args = frame.args if not(args[1] or args.txt) then args = frame:getParent().args end local txt = mw.text.trim(args[1] or args.txt or "") if txt == "" then return nil end local function v2p (x) x = (tonumber(x) or 0) * 100 if x == math.floor(x) then x = math.floor(x) end return x .. "%" end txt = txt:gsub("%d[%d%.]*", v2p) -- store just the string return txt end -- one2a scans through a string, passed as either the first unnamed parameter or |txt= -- it converts each occurrence of 'one ' into either 'a ' or 'an ' and returns the resultant string. p.one2a = function(frame) local args = frame.args if not(args[1] or args.txt) then args = frame:getParent().args end local txt = mw.text.trim(args[1] or args.txt or "") if txt == "" then return nil end txt = txt:gsub(" one ", " a "):gsub("^one", "a"):gsub("One ", "A "):gsub("a ([aeiou])", "an %1"):gsub("A ([aeiou])", "An %1") return txt end -- findpagetext returns the position of a piece of text in a page -- First positional parameter or |text is the search text -- Optional parameter |title is the page title, defaults to current page -- Optional parameter |plain is either true for plain search (default) or false for Lua pattern search -- Optional parameter |nomatch is the return value when no match is found; default is nil p._findpagetext = function(args) -- process parameters local nomatch = args.nomatch or "" if nomatch == "" then nomatch = nil end -- local text = mw.text.trim(args[1] or args.text or "") if text == "" then return nil end -- local title = args.title or "" local titleobj if title == "" then titleobj = mw.title.getCurrentTitle() else titleobj = mw.title.new(title) end -- local plain = args.plain or "" if plain:sub(1, 1) == "f" then plain = false else plain = true end -- get the page content and look for 'text' - return position or nomatch local content = titleobj and titleobj:getContent() return content and mw.ustring.find(content, text, 1, plain) or nomatch end p.findpagetext = function(frame) local args = frame.args local pargs = frame:getParent().args for k, v in pairs(pargs) do args[k] = v end if not (args[1] or args.text) then return nil end -- just the first value return (p._findpagetext(args)) end -- returns the decoded url. Inverse of parser function {{urlencode:val|TYPE}} -- Type is: -- QUERY decodes + to space (default) -- PATH does no extra decoding -- WIKI decodes _ to space p._urldecode = function(url, type) url = url or "" type = (type == "PATH" or type == "WIKI") and type return mw.uri.decode( url, type ) end -- {{#invoke:String2|urldecode|url=url|type=type}} p.urldecode = function(frame) return mw.uri.decode( frame.args.url, frame.args.type ) end -- what follows was merged from [[Module:StringFunc]] -- Argument list helper function, as per [[Module:String]] function p._getParameters( frame_args, arg_list ) local new_args = {}; local index = 1; local value; for i,arg in ipairs( arg_list ) do value = frame_args[arg] if value == nil then value = frame_args[index]; index = index + 1; end new_args[arg] = value; end return new_args; end -- Escape Pattern helper function so that all characters are treated as plain text, as per [[Module:String]] function p._escapePattern( pattern_str ) return mw.ustring.gsub( pattern_str, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1" ) end -- Helper Function to interpret boolean strings, as per [[Module:String]] function p._getBoolean( boolean_str ) local boolean_value; if type( boolean_str ) == 'string' then boolean_str = boolean_str:lower(); if boolean_str == 'false' or boolean_str == 'no' or boolean_str == '0' or boolean_str == '' then boolean_value = false; else boolean_value = true; end elseif type( boolean_str ) == 'boolean' then boolean_value = boolean_str; else error( 'No boolean value found' ); end return boolean_value end --[[ Strip This function Strips characters from string Usage: {{#invoke:String2|strip|source_string|characters_to_strip|plain_flag}} Parameters source: The string to strip chars: The pattern or list of characters to strip from string, replaced with '' plain: A flag indicating that the chars should be understood as plain text. defaults to true. Leading and trailing whitespace is also automatically stripped from the string. ]] function p.strip( frame ) local new_args = p._getParameters( frame.args, {'source', 'chars', 'plain'} ) local source_str = new_args['source'] or '' local chars = new_args['chars'] or '' or 'characters' source_str = mw.text.trim(source_str) if source_str == '' or chars == '' then return source_str end local l_plain = p._getBoolean( new_args['plain'] or true ) if l_plain then chars = p._escapePattern( chars ) end local result result = mw.ustring.gsub(source_str, "["..chars.."]", '') return result end --[[ Match any Returns the index of the first given pattern to match the input. Patterns must be consecutively numbered. Returns the empty string if nothing matches for use in {{#if:}} Usage: {{#invoke:String2|matchAll|source=123 abc|456|abc}} returns '2'. Parameters: source: the string to search plain: A flag indicating that the patterns should be understood as plain text. defaults to true. 1, 2, 3, ...: the patterns to search for ]] function p.matchAny(frame) local source_str = frame.args['source'] or error('The source parameter is mandatory.') local l_plain = p._getBoolean( frame.args['plain'] or true ) for i = 1, math.huge do local pattern = frame.args[i] if not pattern then return '' end if mw.ustring.find(source_str, pattern, 1, l_plain) then return tostring(i) end end end --[[--------------------------< H Y P H E N _ T O _ D A S H >-------------------------------------------------- Converts a hyphen to a dash under certain conditions. The hyphen must separate like items; unlike items are returned unmodified. These forms are modified: letter - letter (A - B) digit - digit (4-5) digit separator digit - digit separator digit (4.1-4.5 or 4-1-4-5) letterdigit - letterdigit (A1-A5) (an optional separator between letter and digit is supported – a.1-a.5 or a-1-a-5) digitletter - digitletter (5a - 5d) (an optional separator between letter and digit is supported – 5.a-5.d or 5-a-5-d) any other forms are returned unmodified. str may be a comma- or semicolon-separated list ]] function p.hyphen_to_dash( str, spacing ) if (str == nil or str == '') then return str end local accept str = mw.text.decode(str, true ) -- replace html entities with their characters; semicolon mucks up the text.split local out = {} local list = mw.text.split (str, '%s*[,;]%s*') -- split str at comma or semicolon separators if there are any for _, item in ipairs (list) do -- for each item in the list item = mw.text.trim(item) -- trim whitespace item, accept = item:gsub ('^%(%((.+)%)%)$', '%1') if accept == 0 and mw.ustring.match (item, '^%w*[%.%-]?%w+%s*[%-–—]%s*%w*[%.%-]?%w+$') then -- if a hyphenated range or has endash or emdash separators if item:match ('^%a+[%.%-]?%d+%s*%-%s*%a+[%.%-]?%d+$') or -- letterdigit hyphen letterdigit (optional separator between letter and digit) item:match ('^%d+[%.%-]?%a+%s*%-%s*%d+[%.%-]?%a+$') or -- digitletter hyphen digitletter (optional separator between digit and letter) item:match ('^%d+[%.%-]%d+%s*%-%s*%d+[%.%-]%d+$') or -- digit separator digit hyphen digit separator digit item:match ('^%d+%s*%-%s*%d+$') or -- digit hyphen digit item:match ('^%a+%s*%-%s*%a+$') then -- letter hyphen letter item = item:gsub ('(%w*[%.%-]?%w+)%s*%-%s*(%w*[%.%-]?%w+)', '%1–%2') -- replace hyphen, remove extraneous space characters else item = mw.ustring.gsub (item, '%s*[–—]%s*', '–') -- for endash or emdash separated ranges, replace em with en, remove extraneous whitespace end end table.insert (out, item) -- add the (possibly modified) item to the output table end local temp_str = table.concat (out, ',' .. spacing) -- concatenate the output table into a comma separated string temp_str, accept = temp_str:gsub ('^%(%((.+)%)%)$', '%1') -- remove accept-this-as-written markup when it wraps all of concatenated out if accept ~= 0 then temp_str = str:gsub ('^%(%((.+)%)%)$', '%1') -- when global markup removed, return original str; do it this way to suppress boolean second return value end return temp_str end function p.hyphen2dash( frame ) local str = frame.args[1] or '' local spacing = frame.args[2] or ' ' -- space is part of the standard separator for normal spacing (but in conjunction with templates r/rp/ran we may need a narrower spacing return p.hyphen_to_dash(str, spacing) end -- Similar to [[Module:String#endswith]] function p.startswith(frame) return (frame.args[1]:sub(1, frame.args[2]:len()) == frame.args[2]) and 'yes' or '' end -- Implements [[Template:Isnumeric]] function p.isnumeric(frame) local s = frame.args[1] or frame:getParent().args[1] local boolean = (frame.args.boolean or frame:getParent().args.boolean) == 'true' if type(s) == 'string' and mw.getContentLanguage():parseFormattedNumber( s ) then return boolean and 1 or s end return boolean and 0 or '' end -- Checks if a value in a group of numbers is not an interger. -- Allows usage of an |empty= parameter to allow empty values to be skipped. function p.isInteger(frame) local values = frame.args or frame:getParent().args local allow_empty = frame.args.empty or frame:getParent().args.empty for _, value in ipairs(values) do -- Trim spaces value = value and value:gsub("^%s*(.-)%s*$", "%1") if value == "" or value == nil then if not allow_empty then return false -- Empty values are not allowed end else value = tonumber(value) if not (type(value) == "number" and value == math.floor(value)) then return false end end end return true end -- Returns an error found in a string. function p.getError(frame) local text = frame.args[1] or frame:getParent().args[1] local error_message = text:match('(<strong class="error">.-</strong>)') return error_message or nil end return p ph89g30kzy2uwl0t05s6jtpby1w86b8