From 71926ae636b13bfb460e7bf747fbf8393e968017 Mon Sep 17 00:00:00 2001 From: Tia i X570-ACE Date: Mon, 16 Dec 2024 14:21:19 +0800 Subject: [PATCH 01/26] =?UTF-8?q?=E5=8A=A0Seediq=20sample=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/testSeediq.py | 32 ++++++++++++++++++ ...210\220\351\237\263\347\250\277Sample.txt" | 13 +++++++ ...10\220\351\237\263\347\250\277Sample.xlsx" | Bin 0 -> 9606 bytes 3 files changed, 45 insertions(+) create mode 100644 tests/testSeediq.py create mode 100644 "tests/\346\240\274\345\274\217\346\252\242\346\237\245/D-SL07-001\357\275\234\345\220\210\346\210\220\351\237\263\347\250\277Sample.txt" create mode 100644 "tests/\346\240\274\345\274\217\346\252\242\346\237\245/D-SL07-001\357\275\234\345\220\210\346\210\220\351\237\263\347\250\277Sample.xlsx" diff --git a/tests/testSeediq.py b/tests/testSeediq.py new file mode 100644 index 0000000..4f0e860 --- /dev/null +++ b/tests/testSeediq.py @@ -0,0 +1,32 @@ +from unittest import TestCase +from os.path import join, abspath, dirname +from pangcah import 找語料名 +from pangcah import xlsx轉錄音稿 + + +class 語料名試驗(TestCase): + def test格式檢查(self): + xlsx檔名 = join( + abspath(dirname(__file__)), + '格式檢查', 'D-SL07-001|合成音稿Sample.xlsx' + ) + self.assertEqual(找語料名(xlsx檔名), 'D-PV01', xlsx檔名) + + +class xlsx轉錄音稿試驗(TestCase): + def test格式檢查(self): + self.maxDiff = None + xlsx檔名 = join( + abspath(dirname(__file__)), + '格式檢查', 'D-SL07-001|合成音稿Sample.xlsx' + ) + 錄音稿檔名 = join( + abspath(dirname(__file__)), + '格式檢查', 'D-SL07-001|合成音稿Sample.txt' + ) + 結果 = xlsx轉錄音稿(xlsx檔名) + 答案 = [] + with open(錄音稿檔名) as 檔案: + for 行 in 檔案.readlines(): + 答案.append(行.rstrip()) + self.assertEqual(結果, 答案) diff --git "a/tests/\346\240\274\345\274\217\346\252\242\346\237\245/D-SL07-001\357\275\234\345\220\210\346\210\220\351\237\263\347\250\277Sample.txt" "b/tests/\346\240\274\345\274\217\346\252\242\346\237\245/D-SL07-001\357\275\234\345\220\210\346\210\220\351\237\263\347\250\277Sample.txt" new file mode 100644 index 0000000..ea6c8ac --- /dev/null +++ "b/tests/\346\240\274\345\274\217\346\252\242\346\237\245/D-SL07-001\357\275\234\345\220\210\346\210\220\351\237\263\347\250\277Sample.txt" @@ -0,0 +1,13 @@ +【D-PV01-1-內文】 +1 +Ga neepah baro ka macu tnkuyan na tama mu rudan. + +2 +Mita ba tama na rudan so mmaha neepah ka Watan dige smoora bale. + +【D-PV01-2-小小讀書會】 +3 +Pnspuwan ta muuyas + +4 +Kari ga srengo so patis nii ge, diff --git "a/tests/\346\240\274\345\274\217\346\252\242\346\237\245/D-SL07-001\357\275\234\345\220\210\346\210\220\351\237\263\347\250\277Sample.xlsx" "b/tests/\346\240\274\345\274\217\346\252\242\346\237\245/D-SL07-001\357\275\234\345\220\210\346\210\220\351\237\263\347\250\277Sample.xlsx" new file mode 100644 index 0000000000000000000000000000000000000000..7506b542e9060d39406ead5dcec2c686827b2da8 GIT binary patch literal 9606 zcmeHtWmsHWvnJBGHSX?C;}En71b26LcS&#$4k17wgy0_BA-F?u4G`Q3BxnK*kaOpd z-1D88xxZ)i)4lipv8rp;s(P#HU0YEG8h`}>4-XGvUKy(e@n~S(-Fw=yx*8eVnz{VC zfLJ{3Z0+Jl<)J{pu*{Dhmfm64K^S71;UIDlhy*a2Hy&U&ZZ}gK?!!gEO0y_i-xm?C zFW~ug<=eYKoq8LMr25{=;d8UR4D%oCtJ_dX=E{KC;zqoHZJB{CwvV(e@@BY{cH!@W zWgsEtMb_MHimm$a;gb5naJ-x}_PjBNVL)`fSD^3`jyMJi8pf$lV--+fH+Vye!;3N< z4~h$(0*R!Zl*IM$r*rT0g;pjzC2f|6jI&{jY71?i2y`+--yA z=F+A@jii7SmZD(eVW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E?ga8>0&>6=ck34j zr%9Jno|n@a17eq8Ar?y}Se|fT?(`bU&x$Z?hJetfPt?PiXFcC|? zc;xq1nV%^;8bxJ&0MXc@ki4rEBNxfHD(*NqP>x1=op|}pH?QQimoeIRBQnN! zea?oK*gNe6kTYk^f)Geb+RU_-bcWp!ZZ-6*y!|QmVBz|Y7{)>VLJ}V90tF-%`0UP> z6M2-vgDDaY^@-L=u$L^O=ZkHGiZ4=1#-N^OBN-m-ekFa=Xs_r=;g&hpLyBz>K_%nB zhNww%LnXWv-oupju{gm`K(pn}W#Hg*9J0tN?-oM$uO!<2Qt!^N?aW+_OpRQP){MC) zIpQ!jjXAMa**UpDoE)_usyS5+r{kay2m%0d(M-|I%yM#~f%=!aC2IJ`7+=*Ut;M95G>7|4i2TKhz@P`9_Y7Ujl}?0DvE>?MY#_mKbx z-&PVJ_x4Wd?7Q!Oj*R=3Qb)|e-qpawoYvPb4Kq5=455ZDZtGKZ8Dd*nfH0p?RirErB|nQz>N1r{rAxgIN=kZd>94#sCXwUV4$*6; zDT8(iJ586rcAPPkVOA}$nkF`6p`iIu-Q{F5swiR#UZc(ug@r-x zoCH$?R7r_eKPhVn3Zv>);HQx#&?kY4^sY7 zm&fe?@4A%2JV^PI+z<}Q!_Wsd(U{{Ec&IB(r&{l7;5(Zl5b zPy_ra=W$ZFhyK6E9Pw{C@6U;kVfXimT_g_*{8t9~bK+w-_ Date: Mon, 16 Dec 2024 14:22:28 +0800 Subject: [PATCH 02/26] =?UTF-8?q?=E4=BF=AEtest=E7=AD=94=E6=A1=88=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/testSeediq.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testSeediq.py b/tests/testSeediq.py index 4f0e860..0ba9918 100644 --- a/tests/testSeediq.py +++ b/tests/testSeediq.py @@ -10,7 +10,7 @@ def test格式檢查(self): abspath(dirname(__file__)), '格式檢查', 'D-SL07-001|合成音稿Sample.xlsx' ) - self.assertEqual(找語料名(xlsx檔名), 'D-PV01', xlsx檔名) + self.assertEqual(找語料名(xlsx檔名), 'D-SL07', xlsx檔名) class xlsx轉錄音稿試驗(TestCase): From a2a15b3119ec1c5c069e53d7f9b096ec725b3611 Mon Sep 17 00:00:00 2001 From: Tia i X570-ACE Date: Mon, 16 Dec 2024 14:23:09 +0800 Subject: [PATCH 03/26] =?UTF-8?q?=E8=AE=8A=E6=95=B8=E8=99=9F=E8=BC=83?= =?UTF-8?q?=E6=98=8E--leh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/testPangcah.py | 4 ++-- tests/testSeediq.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/testPangcah.py b/tests/testPangcah.py index 0b9928f..e38cacd 100644 --- a/tests/testPangcah.py +++ b/tests/testPangcah.py @@ -20,13 +20,13 @@ def test格式檢查(self): abspath(dirname(__file__)), '格式檢查', 'D-PV01|1~353 (C-PL002)sample.xlsx' ) - 錄音稿檔名 = join( + 答案錄音稿檔名 = join( abspath(dirname(__file__)), '格式檢查', 'D-PV01|1~353 (C-PL002)sample.txt' ) 結果 = xlsx轉錄音稿(xlsx檔名) 答案 = [] - with open(錄音稿檔名) as 檔案: + with open(答案錄音稿檔名) as 檔案: for 行 in 檔案.readlines(): 答案.append(行.rstrip()) self.assertEqual(結果, 答案) diff --git a/tests/testSeediq.py b/tests/testSeediq.py index 0ba9918..ec2069f 100644 --- a/tests/testSeediq.py +++ b/tests/testSeediq.py @@ -20,7 +20,7 @@ def test格式檢查(self): abspath(dirname(__file__)), '格式檢查', 'D-SL07-001|合成音稿Sample.xlsx' ) - 錄音稿檔名 = join( + 答案錄音稿檔名 = join( abspath(dirname(__file__)), '格式檢查', 'D-SL07-001|合成音稿Sample.txt' ) From 89480afebf7331dacdab32f3d973a11942993d94 Mon Sep 17 00:00:00 2001 From: Tia i X570-ACE Date: Mon, 16 Dec 2024 14:30:25 +0800 Subject: [PATCH 04/26] =?UTF-8?q?=E4=BF=AEtxt=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seediq.py | 38 +++++++++++++++++++ tests/testSeediq.py | 4 +- ...210\220\351\237\263\347\250\277Sample.txt" | 4 +- 3 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 seediq.py diff --git a/seediq.py b/seediq.py new file mode 100644 index 0000000..bab3013 --- /dev/null +++ b/seediq.py @@ -0,0 +1,38 @@ +import pandas +import re +from os.path import basename +from argparse import ArgumentParser +from pangcah import 找語料名 + + +def xlsx轉錄音稿(xlsx檔名): + 語料名 = 找語料名(xlsx檔名) + 結果 = [] + 錄音編號 = None + for 篇名, dataframe in pandas.read_excel( + xlsx檔名, engine='openpyxl', + sheet_name=None, + ).items(): + 結果.append(f"【{語料名}-{篇名}】") + print("篇名", 篇名) + for 行 in dataframe.fillna('').itertuples(): + if 錄音編號 is not None and 行.錄音編號 != 錄音編號 + 1: + raise ValueError(f"「{篇名}」裡的錄音編號{行.錄音編號}應該要是{錄音編號+1}") + 結果.append(f'{行.錄音編號}') + 結果.append(getattr(行, 'Seediq Tgdaya 語').strip()) + 結果.append('') + 錄音編號 = 行.錄音編號 + return 結果[:-1] + + +def main(): + parser = ArgumentParser(description='產生錄音稿') + parser.add_argument('xlsx檔名') + args = parser.parse_args() + with open(args.xlsx檔名 + '.txt', 'wt') as 檔案: + for 行 in xlsx轉錄音稿(args.xlsx檔名): + print(行, file=檔案) + + +if __name__ == '__main__': + main() diff --git a/tests/testSeediq.py b/tests/testSeediq.py index ec2069f..1249247 100644 --- a/tests/testSeediq.py +++ b/tests/testSeediq.py @@ -1,7 +1,7 @@ from unittest import TestCase from os.path import join, abspath, dirname from pangcah import 找語料名 -from pangcah import xlsx轉錄音稿 +from seediq import xlsx轉錄音稿 class 語料名試驗(TestCase): @@ -26,7 +26,7 @@ def test格式檢查(self): ) 結果 = xlsx轉錄音稿(xlsx檔名) 答案 = [] - with open(錄音稿檔名) as 檔案: + with open(答案錄音稿檔名) as 檔案: for 行 in 檔案.readlines(): 答案.append(行.rstrip()) self.assertEqual(結果, 答案) diff --git "a/tests/\346\240\274\345\274\217\346\252\242\346\237\245/D-SL07-001\357\275\234\345\220\210\346\210\220\351\237\263\347\250\277Sample.txt" "b/tests/\346\240\274\345\274\217\346\252\242\346\237\245/D-SL07-001\357\275\234\345\220\210\346\210\220\351\237\263\347\250\277Sample.txt" index ea6c8ac..16129b2 100644 --- "a/tests/\346\240\274\345\274\217\346\252\242\346\237\245/D-SL07-001\357\275\234\345\220\210\346\210\220\351\237\263\347\250\277Sample.txt" +++ "b/tests/\346\240\274\345\274\217\346\252\242\346\237\245/D-SL07-001\357\275\234\345\220\210\346\210\220\351\237\263\347\250\277Sample.txt" @@ -1,11 +1,11 @@ -【D-PV01-1-內文】 +【D-SL07-1-內文】 1 Ga neepah baro ka macu tnkuyan na tama mu rudan. 2 Mita ba tama na rudan so mmaha neepah ka Watan dige smoora bale. -【D-PV01-2-小小讀書會】 +【D-SL07-2-小小讀書會】 3 Pnspuwan ta muuyas From 8ed1865c177e6d584e4499dbd26f645d6de88136 Mon Sep 17 00:00:00 2001 From: Tia i X570-ACE Date: Wed, 18 Dec 2024 13:46:25 +0800 Subject: [PATCH 05/26] =?UTF-8?q?=E4=BB=8B=E9=9D=A2=E8=AA=BF=E6=95=B4?= =?UTF-8?q?=EF=BC=8C=E6=95=B4=E7=90=86khioh--=E5=87=BA-=E4=BE=86=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 2 +- README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0b658be..7adab43 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,6 +53,6 @@ jobs: - pip install -r requirements.txt script: - bash integrationTestPrepration.sh - - python truku.py D-TL01-005.xlsx + - python patas.py Truku D-TL01-005.xlsx - cat D-TL01-005.txt - cat D-TL01-005.csv diff --git a/README.md b/README.md index 1b7af1f..9411919 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ pip install -r requirements.txt ```bash cd Patas source venv/bin/activate -python truku.py ~/Downloads/1-465|D-TL01-005.xlsx +python patas.py Truku ~/Downloads/1-465|D-TL01-005.xlsx ``` 執行完會產生`1-465|D-TL01-005.xlsx.txt`檔案。 @@ -33,7 +33,7 @@ python truku.py ~/Downloads/1-465|D-TL01-005.xlsx ```bash cd Patas source venv/bin/activate -python pangcah.py ~/Downloads/D-PV01|1\~534\ \(C-PL002\).xlsx +python patas.py Pangcah ~/Downloads/D-PV01|1\~534\ \(C-PL002\).xlsx ``` 執行完會產生`D-PV01|1~534 (C-PL002).xlsx.txt`檔案。 From 2d4bc0d202e8b8315d8263b16f5365e935161dc7 Mon Sep 17 00:00:00 2001 From: Tia i X570-ACE Date: Wed, 18 Dec 2024 13:50:21 +0800 Subject: [PATCH 06/26] =?UTF-8?q?=E6=8C=87=E4=BB=A4khioh--=E5=87=BA-?= =?UTF-8?q?=E4=BE=86=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- patas.py | 26 ++++++++++++++++++++++++++ seediq.py | 2 -- 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 patas.py diff --git a/patas.py b/patas.py new file mode 100644 index 0000000..fe49a95 --- /dev/null +++ b/patas.py @@ -0,0 +1,26 @@ +from argparse import ArgumentParser +import truku +import pangcah +import seediq + + +def main(): + parser = ArgumentParser(description='產生錄音稿') + parser.add_argument('kari', choices=['Truku', 'Pangcah', 'Seediq']) + parser.add_argument('xlsx檔名') + args = parser.parse_args() + if args.kari == 'Truku': + xlsx轉錄音稿 = truku.xlsx轉錄音稿 + elif args.kari == 'Pangcah': + xlsx轉錄音稿 = pangcah.xlsx轉錄音稿 + elif args.kari == 'Seediq': + xlsx轉錄音稿 = seediq.xlsx轉錄音稿 + else: + raise ValueError() + with open(args.xlsx檔名 + '.txt', 'wt') as 檔案: + for 行 in xlsx轉錄音稿(args.xlsx檔名): + print(行, file=檔案) + + +if __name__ == '__main__': + main() diff --git a/seediq.py b/seediq.py index bab3013..4fa4c07 100644 --- a/seediq.py +++ b/seediq.py @@ -1,6 +1,4 @@ import pandas -import re -from os.path import basename from argparse import ArgumentParser from pangcah import 找語料名 From 90f6332e3379930f941f218ab2b291fdbd03b34a Mon Sep 17 00:00:00 2001 From: Tia i X570-ACE Date: Wed, 18 Dec 2024 13:54:17 +0800 Subject: [PATCH 07/26] =?UTF-8?q?=E8=A3=9C=E5=85=B6=E4=BB=96=E6=8C=87?= =?UTF-8?q?=E4=BB=A4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 8 ++++++++ integrationTestPrepration.sh | 2 ++ 2 files changed, 10 insertions(+) diff --git a/.travis.yml b/.travis.yml index 7adab43..67d8548 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,6 +49,14 @@ jobs: -v "`pwd`:/usr/src" sonarsource/sonar-scanner-cli - name: Integration Test + install: + - pip install -r requirements.txt + script: + - bash integrationTestPrepration.sh + - python patas.py Truku D-TL01-005.xlsx + - python patas.py Pangcah D-PV01.xlsx +` - python patas.py Seediq D-SL07-001.txt + - name: Integration Test for Results install: - pip install -r requirements.txt script: diff --git a/integrationTestPrepration.sh b/integrationTestPrepration.sh index 317fbae..fe5f006 100644 --- a/integrationTestPrepration.sh +++ b/integrationTestPrepration.sh @@ -1,3 +1,5 @@ #!/bin/bash cp tests/格式檢查/1-4|D-TL01-005.xlsx D-TL01-005.xlsx +cp 'tests/格式檢查/D-PV01|1~353 (C-PL002)sample.xlsx' D-PV01.xlsx +cp tests/格式檢查/D-SL07-001|合成音稿Sample.txt D-SL07-001.txt From e05fbc5b5a6d47098d310f732b9f81ba9cf23eaa Mon Sep 17 00:00:00 2001 From: Tia i X570-ACE Date: Wed, 18 Dec 2024 13:56:49 +0800 Subject: [PATCH 08/26] =?UTF-8?q?=E4=BF=AEtest=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 2 +- integrationTestPrepration.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 67d8548..5da34b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,7 +55,7 @@ jobs: - bash integrationTestPrepration.sh - python patas.py Truku D-TL01-005.xlsx - python patas.py Pangcah D-PV01.xlsx -` - python patas.py Seediq D-SL07-001.txt +` - python patas.py Seediq D-SL07-001.xlsx - name: Integration Test for Results install: - pip install -r requirements.txt diff --git a/integrationTestPrepration.sh b/integrationTestPrepration.sh index fe5f006..6cdc8d0 100644 --- a/integrationTestPrepration.sh +++ b/integrationTestPrepration.sh @@ -2,4 +2,4 @@ cp tests/格式檢查/1-4|D-TL01-005.xlsx D-TL01-005.xlsx cp 'tests/格式檢查/D-PV01|1~353 (C-PL002)sample.xlsx' D-PV01.xlsx -cp tests/格式檢查/D-SL07-001|合成音稿Sample.txt D-SL07-001.txt +cp tests/格式檢查/D-SL07-001|合成音稿Sample.xlsx D-SL07-001.xlsx From 83bb6fb86b8179b5cd07ade6d3ad7df853ae13c0 Mon Sep 17 00:00:00 2001 From: Tia i X570-ACE Date: Wed, 18 Dec 2024 13:57:21 +0800 Subject: [PATCH 09/26] =?UTF-8?q?=E4=BF=AEyaml=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5da34b1..258bcbe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,7 +55,7 @@ jobs: - bash integrationTestPrepration.sh - python patas.py Truku D-TL01-005.xlsx - python patas.py Pangcah D-PV01.xlsx -` - python patas.py Seediq D-SL07-001.xlsx + - python patas.py Seediq D-SL07-001.xlsx - name: Integration Test for Results install: - pip install -r requirements.txt From 37caaf1a2b2863546c43ea121af8aa3a4bd67c12 Mon Sep 17 00:00:00 2001 From: Asing i Mac M1 16G Date: Wed, 18 Dec 2024 14:03:40 +0800 Subject: [PATCH 10/26] =?UTF-8?q?=E9=85=8D=E5=90=88Truku=20csv=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- patas.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/patas.py b/patas.py index fe49a95..0f04dbc 100644 --- a/patas.py +++ b/patas.py @@ -17,10 +17,16 @@ def main(): xlsx轉錄音稿 = seediq.xlsx轉錄音稿 else: raise ValueError() - with open(args.xlsx檔名 + '.txt', 'wt') as 檔案: + + txt檔名 = args.xlsx檔名.parent / (args.xlsx檔名.stem + '.txt') + with open(txt檔名, 'wt') as 檔案: for 行 in xlsx轉錄音稿(args.xlsx檔名): print(行, file=檔案) + if args.kari == 'Truku': + csv檔名 = args.xlsx檔名.parent / (args.xlsx檔名.stem + '.csv') + truku.xlsx轉csv(args.xlsx檔名, csv檔名) + if __name__ == '__main__': main() From 8b1f75c9ead10c1a5d0faa9974996055a254a2c6 Mon Sep 17 00:00:00 2001 From: Asing i Mac M1 16G Date: Wed, 18 Dec 2024 14:14:27 +0800 Subject: [PATCH 11/26] =?UTF-8?q?=E6=AC=84=E4=BD=8D=E5=90=8D=E9=83=BD?= =?UTF-8?q?=E7=B5=B1=E4=B8=80=E5=8F=AB=E5=81=9ATgdaya=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seediq.py | 2 +- ...10\220\351\237\263\347\250\277Sample.xlsx" | Bin 9606 -> 9590 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/seediq.py b/seediq.py index 4fa4c07..092587b 100644 --- a/seediq.py +++ b/seediq.py @@ -17,7 +17,7 @@ def xlsx轉錄音稿(xlsx檔名): if 錄音編號 is not None and 行.錄音編號 != 錄音編號 + 1: raise ValueError(f"「{篇名}」裡的錄音編號{行.錄音編號}應該要是{錄音編號+1}") 結果.append(f'{行.錄音編號}') - 結果.append(getattr(行, 'Seediq Tgdaya 語').strip()) + 結果.append(getattr(行, 'Tgdaya').strip()) 結果.append('') 錄音編號 = 行.錄音編號 return 結果[:-1] diff --git "a/tests/\346\240\274\345\274\217\346\252\242\346\237\245/D-SL07-001\357\275\234\345\220\210\346\210\220\351\237\263\347\250\277Sample.xlsx" "b/tests/\346\240\274\345\274\217\346\252\242\346\237\245/D-SL07-001\357\275\234\345\220\210\346\210\220\351\237\263\347\250\277Sample.xlsx" index 7506b542e9060d39406ead5dcec2c686827b2da8..12a94f1b093122fa193066a0bad6062a556fb0ab 100644 GIT binary patch delta 2673 zcmZWr2UJtp7EMB((4v3>36e$~ItF2AN*lVAfP@g~p%>|*5JOSA;6r2pK?rpQl@5Y{ z)BpoW6)^KrM?{LFG-2cm{E%5|7W(g6@2z*w-DjV(&O3MCd((W!jL+Jfja>-D&CLxe zt;^2llcuy=^(qV9EWQy{`?S)^w#s^@QQzcl7K}|nO*MnzxG7mrGIL;ezp#39I?1Xk zDTzv@zLzZvrY7{3qiKg*vAT5KhhrSxuM1@?%adKLw@^rTq=%gG3GJ1r4ia}`H+sMV zda^s+XU;dciC5Qy-I1`&Ej3VPnYfKaA=dIOC@HmfOYjKzH9V%w&M2ftP@mUZW_zFW z&par%kf?Epl27CstPfww>-}>c!+5{6+ZRNg)1I8m{DBd4BX(%O*+)6c!wo$*H)4)+ zwv_19!E@9EKYp=w@Aj;hZh@9^4QFr6LG-8O7~F(JzeX?r{3GMdm9PW+LcLu^jiUD# z(&i{C19E}lLKM>hR6>zA>vJH%5gpN8?Hl1XwM6s9K2aT-kJ*Q!>-Qq7CkO7P>U|mJ z-{@L)w2B*f9hJHxZEeoQJ(1usbsh`?orQov-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^*+Ta-saT$y-jQTd zVonktT1bX>t&mcO?rD9$5@?}2e(ta=NW0En5+VK|wL-)!u((RZJD_=DDoC#sTgU};NO_=d$FEh?%DFZ@_Jn|9sk zozVl{MjwiBb1Z-AQRbZ#txU$<2}V~{TwgSCE_7Y&D!hi_{<1rExNZ@c<5=TgKI)h(D(Y>rY)4D_Bk_oK zeT5{>Q~uOI?DL)!3%dqO61>LrQ3KzT%l_jsFQ+MxsF2dKtr%8pf#OQg#EAi?y@x{mm!4X!?v?S$*zRs))5iD^V4fpCp8hd7FUhZ^BZrg ztwuN16e?lpkH`W#KQ(Huz#6X4Vx7_+lGEd@RxQx)AR@hjqM6m>ssNHUsyT+7o%k zV*gCFA;rJAE!xkuJF$3Dqj#HY6QRiT5p?4L+tkd*mNbn%wY%4C?*kq$!w$tvt&E_4 z)8;Fo`dS4nH+cB2b&VxkfBdoa{ms_h{8w%>Ki%}sa@TeReAVoHtFwE@va-U`4Zr}v z3iMx1k&c5O0dWNOy5yO^g?aqY5=Us;rA9du_oNGe``9Aw_)ll0naLiN+4bzzei&fy zhzHX0fCp){vVt70HdzEvj5aB&^pE91lSTe*;gJYX6&EcVO02B!U0OEUt04M_NWpJ8=oFE4noUowM$p$=RtBKq%z{5~lH4?#YCDe7qBa&jEZ-UROZg?gAKE-&f4%X6YT%lIohv^jgP`+vdU z;Q+u@f6cHF8OI(CHoWbKoAV@&u^fkxRS5V}}$nHY^ E2iTf>ivR!s From dcace2b6aacd0cedd903a9e5ab00e6fe574c9233 Mon Sep 17 00:00:00 2001 From: Asing i Mac M1 16G Date: Wed, 18 Dec 2024 14:18:05 +0800 Subject: [PATCH 12/26] =?UTF-8?q?=E8=A3=9CSeediq=E8=AA=AA=E6=98=8E?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 14 +++++++++++++- patas.py | 3 ++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9411919..18a4c93 100644 --- a/README.md +++ b/README.md @@ -36,4 +36,16 @@ source venv/bin/activate python patas.py Pangcah ~/Downloads/D-PV01|1\~534\ \(C-PL002\).xlsx ``` -執行完會產生`D-PV01|1~534 (C-PL002).xlsx.txt`檔案。 +執行完會產生`D-PV01|1~534 (C-PL002).txt`檔案。 + +### Kari Seediq + +從Google Sheet下載錄音稿,假設下載後檔名是`D-SL07-001|合成音稿Sample.xlsx` + +```bash +cd Patas +source venv/bin/activate +python patas.py Seediq ~/Downloads/D-SL07-001|合成音稿Sample.xlsx +``` + +執行完會產生`D-SL07-001|合成音稿Sample.txt`檔案。 diff --git a/patas.py b/patas.py index 0f04dbc..6f74300 100644 --- a/patas.py +++ b/patas.py @@ -1,4 +1,5 @@ from argparse import ArgumentParser +from pathlib import Path import truku import pangcah import seediq @@ -7,7 +8,7 @@ def main(): parser = ArgumentParser(description='產生錄音稿') parser.add_argument('kari', choices=['Truku', 'Pangcah', 'Seediq']) - parser.add_argument('xlsx檔名') + parser.add_argument('xlsx檔名', type=Path) args = parser.parse_args() if args.kari == 'Truku': xlsx轉錄音稿 = truku.xlsx轉錄音稿 From 647c6ffb9b0f1f36d0a9e187dbb9e23f5b19d5d0 Mon Sep 17 00:00:00 2001 From: Asing i Mac M1 16G Date: Wed, 18 Dec 2024 14:26:59 +0800 Subject: [PATCH 13/26] =?UTF-8?q?=E6=8C=87=E4=BB=A4=E9=83=A8=E4=BB=BD?= =?UTF-8?q?=E5=88=AA=E9=99=A4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pangcah.py | 14 -------------- seediq.py | 14 -------------- truku.py | 18 ------------------ 3 files changed, 46 deletions(-) diff --git a/pangcah.py b/pangcah.py index b2dc911..39d40c7 100644 --- a/pangcah.py +++ b/pangcah.py @@ -1,7 +1,6 @@ import pandas import re from os.path import basename -from argparse import ArgumentParser def xlsx轉錄音稿(xlsx檔名): @@ -26,16 +25,3 @@ def xlsx轉錄音稿(xlsx檔名): def 找語料名(xlsx檔名): return re.search(r'D-[STP][LVTR]\d\d', basename(xlsx檔名)).group(0) - - -def main(): - parser = ArgumentParser(description='產生錄音稿') - parser.add_argument('xlsx檔名') - args = parser.parse_args() - with open(args.xlsx檔名 + '.txt', 'wt') as 檔案: - for 行 in xlsx轉錄音稿(args.xlsx檔名): - print(行, file=檔案) - - -if __name__ == '__main__': - main() diff --git a/seediq.py b/seediq.py index 092587b..024a36a 100644 --- a/seediq.py +++ b/seediq.py @@ -1,5 +1,4 @@ import pandas -from argparse import ArgumentParser from pangcah import 找語料名 @@ -21,16 +20,3 @@ def xlsx轉錄音稿(xlsx檔名): 結果.append('') 錄音編號 = 行.錄音編號 return 結果[:-1] - - -def main(): - parser = ArgumentParser(description='產生錄音稿') - parser.add_argument('xlsx檔名') - args = parser.parse_args() - with open(args.xlsx檔名 + '.txt', 'wt') as 檔案: - for 行 in xlsx轉錄音稿(args.xlsx檔名): - print(行, file=檔案) - - -if __name__ == '__main__': - main() diff --git a/truku.py b/truku.py index 25ef41b..0040ca6 100644 --- a/truku.py +++ b/truku.py @@ -1,9 +1,7 @@ import pandas import re from os.path import basename -from argparse import ArgumentParser from csv import DictWriter -from pathlib import Path def xlsx轉錄音稿(xlsx檔名): @@ -48,19 +46,3 @@ def 讀xlsx資料(xlsx檔名): sheet_name=None, ).items(): yield 篇名, dataframe.fillna('').itertuples() - - -def main(): - parser = ArgumentParser(description='San-sing su-pio.') - parser.add_argument('xlsx檔名', type=Path) - args = parser.parse_args() - txt檔名 = args.xlsx檔名.parent / (args.xlsx檔名.stem + '.txt') - with open(txt檔名, 'wt') as 檔案: - for 行 in xlsx轉錄音稿(args.xlsx檔名): - print(行, file=檔案) - csv檔名 = args.xlsx檔名.parent / (args.xlsx檔名.stem + '.csv') - xlsx轉csv(args.xlsx檔名, csv檔名) - - -if __name__ == '__main__': - main() From 34af9cb738ab8d7fba09add2c6740cd69eca58b5 Mon Sep 17 00:00:00 2001 From: Tia i X570-ACE Date: Wed, 18 Dec 2024 14:58:35 +0800 Subject: [PATCH 14/26] =?UTF-8?q?coverage=E5=90=AB=E6=95=B4=E5=90=88?= =?UTF-8?q?=E8=A9=A6=E9=A9=97=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 258bcbe..7b4dd95 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,19 +48,26 @@ jobs: -e SONAR_TOKEN="${SONAR_TOKEN}" -v "`pwd`:/usr/src" sonarsource/sonar-scanner-cli - - name: Integration Test + - name: Integration Test for Results install: - pip install -r requirements.txt script: - bash integrationTestPrepration.sh - python patas.py Truku D-TL01-005.xlsx - - python patas.py Pangcah D-PV01.xlsx - - python patas.py Seediq D-SL07-001.xlsx - - name: Integration Test for Results + - cat D-TL01-005.txt + - cat D-TL01-005.csv + - name: Integration Test for Coverage install: - pip install -r requirements.txt script: - bash integrationTestPrepration.sh - - python patas.py Truku D-TL01-005.xlsx - - cat D-TL01-005.txt - - cat D-TL01-005.csv + - tox -e test + - coverage run -a patas.py Truku D-TL01-005.xlsx + - coverage run -a patas.py Pangcah D-PV01.xlsx + - coverage run -a patas.py Seediq D-SL07-001.xlsx + - > + docker run --rm + -e SONARQUBE_SCANNER_PARAMS + -e SONAR_TOKEN="${SONAR_TOKEN}" + -v "`pwd`:/usr/src" + sonarsource/sonar-scanner-cli From 7d680d5202afc4db57f757318de00811bdb058fc Mon Sep 17 00:00:00 2001 From: Tia i X570-ACE Date: Wed, 18 Dec 2024 15:06:58 +0800 Subject: [PATCH 15/26] =?UTF-8?q?=E7=A8=8B=E5=BC=8F=E6=95=B4=E7=90=86?= =?UTF-8?q?=E5=87=BA=E4=BE=86=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pangcah.py | 24 ++----------------- seediq.py | 21 ++-------------- tests/testPangcah.py | 2 +- tests/testSeediq.py | 4 ++-- ...210\220\351\237\263\347\250\277Sample.txt" | 4 ++-- truku.py | 7 ++++-- 6 files changed, 14 insertions(+), 48 deletions(-) diff --git a/pangcah.py b/pangcah.py index 39d40c7..f4fde59 100644 --- a/pangcah.py +++ b/pangcah.py @@ -1,27 +1,7 @@ import pandas import re from os.path import basename - +from truku import xlsx轉錄音稿kari def xlsx轉錄音稿(xlsx檔名): - 語料名 = 找語料名(xlsx檔名) - 結果 = [] - 錄音編號 = None - for 篇名, dataframe in pandas.read_excel( - xlsx檔名, engine='openpyxl', - sheet_name=None, - ).items(): - 結果.append(f"【{語料名}-{篇名}】") - print("篇名", 篇名) - for 行 in dataframe.fillna('').itertuples(): - if 錄音編號 is not None and 行.錄音編號 != 錄音編號 + 1: - raise ValueError(f"「{篇名}」裡的錄音編號{行.錄音編號}應該要是{錄音編號+1}") - 結果.append(f'{行.錄音編號}') - 結果.append(行.阿美語.strip()) - 結果.append('') - 錄音編號 = 行.錄音編號 - return 結果[:-1] - - -def 找語料名(xlsx檔名): - return re.search(r'D-[STP][LVTR]\d\d', basename(xlsx檔名)).group(0) + return xlsx轉錄音稿kari(xlsx檔名, '阿美語') diff --git a/seediq.py b/seediq.py index 024a36a..1e4ce59 100644 --- a/seediq.py +++ b/seediq.py @@ -1,22 +1,5 @@ -import pandas -from pangcah import 找語料名 +from truku import xlsx轉錄音稿kari def xlsx轉錄音稿(xlsx檔名): - 語料名 = 找語料名(xlsx檔名) - 結果 = [] - 錄音編號 = None - for 篇名, dataframe in pandas.read_excel( - xlsx檔名, engine='openpyxl', - sheet_name=None, - ).items(): - 結果.append(f"【{語料名}-{篇名}】") - print("篇名", 篇名) - for 行 in dataframe.fillna('').itertuples(): - if 錄音編號 is not None and 行.錄音編號 != 錄音編號 + 1: - raise ValueError(f"「{篇名}」裡的錄音編號{行.錄音編號}應該要是{錄音編號+1}") - 結果.append(f'{行.錄音編號}') - 結果.append(getattr(行, 'Tgdaya').strip()) - 結果.append('') - 錄音編號 = 行.錄音編號 - return 結果[:-1] + return xlsx轉錄音稿kari(xlsx檔名, 'Tgdaya') diff --git a/tests/testPangcah.py b/tests/testPangcah.py index e38cacd..fe92cac 100644 --- a/tests/testPangcah.py +++ b/tests/testPangcah.py @@ -1,6 +1,6 @@ from unittest import TestCase from os.path import join, abspath, dirname -from pangcah import 找語料名 +from truku import 找語料名 from pangcah import xlsx轉錄音稿 diff --git a/tests/testSeediq.py b/tests/testSeediq.py index 1249247..d543283 100644 --- a/tests/testSeediq.py +++ b/tests/testSeediq.py @@ -1,6 +1,6 @@ from unittest import TestCase from os.path import join, abspath, dirname -from pangcah import 找語料名 +from truku import 找語料名 from seediq import xlsx轉錄音稿 @@ -10,7 +10,7 @@ def test格式檢查(self): abspath(dirname(__file__)), '格式檢查', 'D-SL07-001|合成音稿Sample.xlsx' ) - self.assertEqual(找語料名(xlsx檔名), 'D-SL07', xlsx檔名) + self.assertEqual(找語料名(xlsx檔名), 'D-SL07-001', xlsx檔名) class xlsx轉錄音稿試驗(TestCase): diff --git "a/tests/\346\240\274\345\274\217\346\252\242\346\237\245/D-SL07-001\357\275\234\345\220\210\346\210\220\351\237\263\347\250\277Sample.txt" "b/tests/\346\240\274\345\274\217\346\252\242\346\237\245/D-SL07-001\357\275\234\345\220\210\346\210\220\351\237\263\347\250\277Sample.txt" index 16129b2..67edb95 100644 --- "a/tests/\346\240\274\345\274\217\346\252\242\346\237\245/D-SL07-001\357\275\234\345\220\210\346\210\220\351\237\263\347\250\277Sample.txt" +++ "b/tests/\346\240\274\345\274\217\346\252\242\346\237\245/D-SL07-001\357\275\234\345\220\210\346\210\220\351\237\263\347\250\277Sample.txt" @@ -1,11 +1,11 @@ -【D-SL07-1-內文】 +【D-SL07-001-1-內文】 1 Ga neepah baro ka macu tnkuyan na tama mu rudan. 2 Mita ba tama na rudan so mmaha neepah ka Watan dige smoora bale. -【D-SL07-2-小小讀書會】 +【D-SL07-001-2-小小讀書會】 3 Pnspuwan ta muuyas diff --git a/truku.py b/truku.py index 0040ca6..2e84f97 100644 --- a/truku.py +++ b/truku.py @@ -5,6 +5,9 @@ def xlsx轉錄音稿(xlsx檔名): + return xlsx轉錄音稿kari(xlsx檔名, '太魯閣語') + +def xlsx轉錄音稿kari(xlsx檔名, kari): 語料名 = 找語料名(xlsx檔名) 結果 = [] 錄音編號 = None @@ -14,7 +17,7 @@ def xlsx轉錄音稿(xlsx檔名): if 錄音編號 is not None and 行.錄音編號 != 錄音編號 + 1: raise ValueError(f"「{篇名}」裡的錄音編號{行.錄音編號}應該要是{錄音編號+1}") 結果.append(f'{行.錄音編號}') - 結果.append(行.太魯閣語.strip()) + 結果.append(getattr(行, kari).strip()) 結果.append('') 錄音編號 = 行.錄音編號 return 結果[:-1] @@ -37,7 +40,7 @@ def xlsx轉csv(xlsx檔名, csv檔名): def 找語料名(xlsx檔名): - return re.search(r'D-[STP][LVTR]\d\d-\d\d\d', basename(xlsx檔名)).group(0) + return re.search(r'D-[STP][LVTR]\d\d(-\d\d\d)?', basename(xlsx檔名)).group(0) def 讀xlsx資料(xlsx檔名): From 5c208971d9ea8088266fa2ff833686843953ef6a Mon Sep 17 00:00:00 2001 From: Tia i X570-ACE Date: Wed, 18 Dec 2024 15:14:16 +0800 Subject: [PATCH 16/26] =?UTF-8?q?=E5=8F=83=E6=95=B8t=C4=AB=20patas.py?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- patas.py | 12 +++++------- tests/testPangcah.py | 4 ++-- tests/testSeediq.py | 4 ++-- ...0\275\211\351\214\204\351\237\263\347\250\277.py" | 6 +++--- truku.py | 3 --- 5 files changed, 12 insertions(+), 17 deletions(-) diff --git a/patas.py b/patas.py index 6f74300..6ac2f42 100644 --- a/patas.py +++ b/patas.py @@ -1,8 +1,6 @@ from argparse import ArgumentParser from pathlib import Path -import truku -import pangcah -import seediq +from truku import xlsx轉錄音稿kari def main(): @@ -11,17 +9,17 @@ def main(): parser.add_argument('xlsx檔名', type=Path) args = parser.parse_args() if args.kari == 'Truku': - xlsx轉錄音稿 = truku.xlsx轉錄音稿 + kari = '太魯閣語' elif args.kari == 'Pangcah': - xlsx轉錄音稿 = pangcah.xlsx轉錄音稿 + kari = '阿美語' elif args.kari == 'Seediq': - xlsx轉錄音稿 = seediq.xlsx轉錄音稿 + kari = 'Tgdaya' else: raise ValueError() txt檔名 = args.xlsx檔名.parent / (args.xlsx檔名.stem + '.txt') with open(txt檔名, 'wt') as 檔案: - for 行 in xlsx轉錄音稿(args.xlsx檔名): + for 行 in xlsx轉錄音稿kari(args.xlsx檔名, kari): print(行, file=檔案) if args.kari == 'Truku': diff --git a/tests/testPangcah.py b/tests/testPangcah.py index fe92cac..4a6d47a 100644 --- a/tests/testPangcah.py +++ b/tests/testPangcah.py @@ -1,7 +1,7 @@ from unittest import TestCase from os.path import join, abspath, dirname from truku import 找語料名 -from pangcah import xlsx轉錄音稿 +from truku import xlsx轉錄音稿kari class 語料名試驗(TestCase): @@ -24,7 +24,7 @@ def test格式檢查(self): abspath(dirname(__file__)), '格式檢查', 'D-PV01|1~353 (C-PL002)sample.txt' ) - 結果 = xlsx轉錄音稿(xlsx檔名) + 結果 = xlsx轉錄音稿kari(xlsx檔名, '阿美語') 答案 = [] with open(答案錄音稿檔名) as 檔案: for 行 in 檔案.readlines(): diff --git a/tests/testSeediq.py b/tests/testSeediq.py index d543283..c72c79a 100644 --- a/tests/testSeediq.py +++ b/tests/testSeediq.py @@ -1,7 +1,7 @@ from unittest import TestCase from os.path import join, abspath, dirname from truku import 找語料名 -from seediq import xlsx轉錄音稿 +from truku import xlsx轉錄音稿kari class 語料名試驗(TestCase): @@ -24,7 +24,7 @@ def test格式檢查(self): abspath(dirname(__file__)), '格式檢查', 'D-SL07-001|合成音稿Sample.txt' ) - 結果 = xlsx轉錄音稿(xlsx檔名) + 結果 = xlsx轉錄音稿kari(xlsx檔名, 'Tgdaya') 答案 = [] with open(答案錄音稿檔名) as 檔案: for 行 in 檔案.readlines(): diff --git "a/tests/test\350\275\211\351\214\204\351\237\263\347\250\277.py" "b/tests/test\350\275\211\351\214\204\351\237\263\347\250\277.py" index 3b83f95..d828209 100644 --- "a/tests/test\350\275\211\351\214\204\351\237\263\347\250\277.py" +++ "b/tests/test\350\275\211\351\214\204\351\237\263\347\250\277.py" @@ -1,6 +1,6 @@ from unittest import TestCase from os.path import join, abspath, dirname -from truku import xlsx轉錄音稿 +from truku import xlsx轉錄音稿kari class xlsx轉錄音稿試驗(TestCase): @@ -12,7 +12,7 @@ def test格式檢查(self): 錄音稿檔名 = join( abspath(dirname(__file__)), '格式檢查', '1-4|D-TL01-005.txt' ) - 結果 = xlsx轉錄音稿(xlsx檔名) + 結果 = xlsx轉錄音稿kari(xlsx檔名, '太魯閣語') 答案 = [] with open(錄音稿檔名) as 檔案: for 行 in 檔案.readlines(): @@ -25,4 +25,4 @@ def test編號錯誤(self): abspath(dirname(__file__)), '錄音編號錯誤', 'D-TL01-005.xlsx' ) with self.assertRaises(ValueError): - xlsx轉錄音稿(xlsx檔名) + xlsx轉錄音稿kari(xlsx檔名, '太魯閣語') diff --git a/truku.py b/truku.py index 2e84f97..1292e5e 100644 --- a/truku.py +++ b/truku.py @@ -4,9 +4,6 @@ from csv import DictWriter -def xlsx轉錄音稿(xlsx檔名): - return xlsx轉錄音稿kari(xlsx檔名, '太魯閣語') - def xlsx轉錄音稿kari(xlsx檔名, kari): 語料名 = 找語料名(xlsx檔名) 結果 = [] From 9f430c1d0e087fc43f363a43117861d453a47c30 Mon Sep 17 00:00:00 2001 From: Tia i X570-ACE Date: Wed, 18 Dec 2024 15:16:38 +0800 Subject: [PATCH 17/26] =?UTF-8?q?csv=E5=8F=83=E6=95=B8=E5=98=9Bkhioh?= =?UTF-8?q?=E5=87=BA=E4=BE=86=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pangcah.py | 7 ------- patas.py | 7 +++---- seediq.py | 5 ----- truku.py | 4 ++-- 4 files changed, 5 insertions(+), 18 deletions(-) delete mode 100644 pangcah.py delete mode 100644 seediq.py diff --git a/pangcah.py b/pangcah.py deleted file mode 100644 index f4fde59..0000000 --- a/pangcah.py +++ /dev/null @@ -1,7 +0,0 @@ -import pandas -import re -from os.path import basename -from truku import xlsx轉錄音稿kari - -def xlsx轉錄音稿(xlsx檔名): - return xlsx轉錄音稿kari(xlsx檔名, '阿美語') diff --git a/patas.py b/patas.py index 6ac2f42..52782b7 100644 --- a/patas.py +++ b/patas.py @@ -1,6 +1,6 @@ from argparse import ArgumentParser from pathlib import Path -from truku import xlsx轉錄音稿kari +from truku import xlsx轉錄音稿kari, xlsx轉csv def main(): @@ -22,9 +22,8 @@ def main(): for 行 in xlsx轉錄音稿kari(args.xlsx檔名, kari): print(行, file=檔案) - if args.kari == 'Truku': - csv檔名 = args.xlsx檔名.parent / (args.xlsx檔名.stem + '.csv') - truku.xlsx轉csv(args.xlsx檔名, csv檔名) + csv檔名 = args.xlsx檔名.parent / (args.xlsx檔名.stem + '.csv') + xlsx轉csv(args.xlsx檔名, kari, csv檔名) if __name__ == '__main__': diff --git a/seediq.py b/seediq.py deleted file mode 100644 index 1e4ce59..0000000 --- a/seediq.py +++ /dev/null @@ -1,5 +0,0 @@ -from truku import xlsx轉錄音稿kari - - -def xlsx轉錄音稿(xlsx檔名): - return xlsx轉錄音稿kari(xlsx檔名, 'Tgdaya') diff --git a/truku.py b/truku.py index 1292e5e..13c7964 100644 --- a/truku.py +++ b/truku.py @@ -20,10 +20,10 @@ def xlsx轉錄音稿kari(xlsx檔名, kari): return 結果[:-1] -def xlsx轉csv(xlsx檔名, csv檔名): +def xlsx轉csv(xlsx檔名, kari, csv檔名): with open(csv檔名, 'wt') as 檔案: writer = DictWriter(檔案, fieldnames=[ - '錄音編號', '篇名', '太魯閣語', '華語', + '錄音編號', '篇名', kari, '華語', ]) writer.writeheader() for 篇名, dataframe in 讀xlsx資料(xlsx檔名): From 3ac0c1c086a4290667304f89affdbfdeca19d3b9 Mon Sep 17 00:00:00 2001 From: Tia i X570-ACE Date: Wed, 18 Dec 2024 15:17:42 +0800 Subject: [PATCH 18/26] =?UTF-8?q?=E6=95=B4=E7=90=86=E7=A8=8B=E5=BC=8F?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "tests/test\350\275\211csv.py" | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git "a/tests/test\350\275\211csv.py" "b/tests/test\350\275\211csv.py" index 297e1f3..fed54e3 100644 --- "a/tests/test\350\275\211csv.py" +++ "b/tests/test\350\275\211csv.py" @@ -13,7 +13,7 @@ def test格式檢查(self): csv檔名 = join( abspath(dirname(__file__)), '格式檢查', '1-4|D-TL01-005.csv' ) - xlsx轉csv(xlsx檔名, csv檔名) + xlsx轉csv(xlsx檔名, '太魯閣語', csv檔名) 答案 = { '錄音編號': '4', '篇名': '我眺望山嶺時', @@ -25,4 +25,4 @@ def test格式檢查(self): '華語': '從小至今,不知為何總是喜歡跳望山嶺!到底是何因由呢?', } with open(csv檔名) as 檔案: - self.assertIn(答案, list(DictReader(檔案))) + self.assertEqual(答案, list(DictReader(檔案))[3]) From a31cca55e6f9739e9db38153a78129a97f7b0678 Mon Sep 17 00:00:00 2001 From: Tia i X570-ACE Date: Wed, 18 Dec 2024 15:37:30 +0800 Subject: [PATCH 19/26] =?UTF-8?q?=E8=A3=9Ctox=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 7b4dd95..0493b34 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,6 +58,7 @@ jobs: - cat D-TL01-005.csv - name: Integration Test for Coverage install: + - pip install tox - pip install -r requirements.txt script: - bash integrationTestPrepration.sh From 7da56e3433326639643d40134e44b03307aea748 Mon Sep 17 00:00:00 2001 From: Tia i X570-ACE Date: Wed, 18 Dec 2024 15:49:29 +0800 Subject: [PATCH 20/26] =?UTF-8?q?=E6=95=B4=E5=90=88=E8=A9=A6=E9=A9=97khioh?= =?UTF-8?q?=E5=8E=BBtox=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 16 +++------------- tox.ini | 11 +++++++++++ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0493b34..0114d27 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,24 +48,14 @@ jobs: -e SONAR_TOKEN="${SONAR_TOKEN}" -v "`pwd`:/usr/src" sonarsource/sonar-scanner-cli - - name: Integration Test for Results + - name: Integration Test install: - - pip install -r requirements.txt + - pip install tox script: - bash integrationTestPrepration.sh - - python patas.py Truku D-TL01-005.xlsx + - tox -e integrationTest - cat D-TL01-005.txt - cat D-TL01-005.csv - - name: Integration Test for Coverage - install: - - pip install tox - - pip install -r requirements.txt - script: - - bash integrationTestPrepration.sh - - tox -e test - - coverage run -a patas.py Truku D-TL01-005.xlsx - - coverage run -a patas.py Pangcah D-PV01.xlsx - - coverage run -a patas.py Seediq D-SL07-001.xlsx - > docker run --rm -e SONARQUBE_SCANNER_PARAMS diff --git a/tox.ini b/tox.ini index 325b32c..7f413e9 100644 --- a/tox.ini +++ b/tox.ini @@ -35,3 +35,14 @@ deps = commands = coverage run -m unittest {posargs} coverage xml + +[testenv:integrationTest] +deps = + -rrequirements.txt + coverage +commands = + coverage run -m unittest {posargs} + coverage run -a patas.py Truku D-TL01-005.xlsx + coverage run -a patas.py Pangcah D-PV01.xlsx + coverage run -a patas.py Seediq D-SL07-001.xlsx + coverage xml From daa876caf161a7bc958e51a834c57a5ac5ec6a82 Mon Sep 17 00:00:00 2001 From: Tia i X570-ACE Date: Wed, 18 Dec 2024 15:55:20 +0800 Subject: [PATCH 21/26] =?UTF-8?q?=E4=BF=AEcsv=E7=A8=8B=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- truku.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/truku.py b/truku.py index 13c7964..003e5fb 100644 --- a/truku.py +++ b/truku.py @@ -31,7 +31,7 @@ def xlsx轉csv(xlsx檔名, kari, csv檔名): writer.writerow({ '錄音編號': 行.錄音編號, '篇名': 篇名.strip(), - '太魯閣語': 行.太魯閣語.strip(), + kari: 行.太魯閣語.strip(), '華語': 行.華語.strip(), }) From 5fda0fdbb8a95abac695ea4454f282f91286e971 Mon Sep 17 00:00:00 2001 From: Tia i X570-ACE Date: Wed, 18 Dec 2024 16:45:05 +0800 Subject: [PATCH 22/26] =?UTF-8?q?=E4=BF=AE=E7=A8=8B=E5=BC=8F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- truku.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/truku.py b/truku.py index 003e5fb..d7a601c 100644 --- a/truku.py +++ b/truku.py @@ -31,7 +31,7 @@ def xlsx轉csv(xlsx檔名, kari, csv檔名): writer.writerow({ '錄音編號': 行.錄音編號, '篇名': 篇名.strip(), - kari: 行.太魯閣語.strip(), + kari: getattr(行, kari).strip(), '華語': 行.華語.strip(), }) From 7f30c446e3c4b793e5a6e340b4877e9b0b1edf8a Mon Sep 17 00:00:00 2001 From: Tia i X570-ACE Date: Fri, 20 Dec 2024 11:50:32 +0800 Subject: [PATCH 23/26] =?UTF-8?q?=E8=A3=9C=E5=8D=B0=E7=AF=87=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...V01\357\275\2341~353 (C-PL002)sample.xlsx" | Bin 12711 -> 14094 bytes truku.py | 2 ++ 2 files changed, 2 insertions(+) diff --git "a/tests/\346\240\274\345\274\217\346\252\242\346\237\245/D-PV01\357\275\2341~353 (C-PL002)sample.xlsx" "b/tests/\346\240\274\345\274\217\346\252\242\346\237\245/D-PV01\357\275\2341~353 (C-PL002)sample.xlsx" index 6849943f752cac7758c62f83458c23651531af81..e8afa6afaeb00ae615a9324dfd3ef9d115911976 100644 GIT binary patch literal 14094 zcmeI3cT`hbx3@tQ5DRiNAksWaS9+HwA|TSM(vjXnk(vZV-5}DWOK74HdM}|PA|PD| z9Rf%RHM9T$Lb>2M?{~a@?|a4>_pdwdaAuBV?LD&A-kEETm9?Moo9ap=r>_u^lamv1 zF-GeV{b1*g+a|7-4sJZ$C+~TY-499lE(NZ_UcZ5OmV@qFl+?cZn(zSj>}|*46Onjc zT6Y-a1-X7!I$5})FRoKW7LNYSYU_2P!fSbOw*IYGr$4=ES%OLVpNk2-I5={{tp zG;ho9`|PlJJ<^G|n2vYIP~+2M<2zHP>GYL>7HA8|OGhIUk|T@x?N?db<2K`jP~AZM z%ecascpYB@>}qcY2HSIcIXZ-DDMg}qFQMHi;is$qdqO}?* zMu*8+w6btSS+G;zt{}Npr}UWD@EPj-OM|cF)4yN2()6jk5AAc1yyxvz+FId$_Mrd= zbV``P%>R`|$LCLMYF$>Lj76oXHxPytYpv9RV%N~L`RV!rn%rCxJf&)y<{SQwOYA_% zBBDdalr@6$11Zw($&w*)s5^xzzY`=3RVL7OI_nbYq93nCWFa{#zrN*l zZ*x_VZ+z(@T5wuVu$!s(ye(O@!e>TwuWxSd8~Jt}sYbgL=4ku7sab~76e;&C)Tw3@ zAM*)KZYOydZP2|Gd>rJ+`}lMhZSGb9w1|r;Jl*V(=GC^jh{#03=gj^(y5EFu?-^Jb z8}`v&aAz1Z*EKZ6@cFzeCu^zQq&HI?HN6Q7(y^0uCK8$F|k+Xv3*JN^@6g&dl7$RgsTxH9(#fb-Z! zr%ggal7-1#u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W{HjG4VhW*U_>@xt3zA#Xc|9XIMzB#ow49_oj@XS9CSyRae(K7_$bBm^^;7I$>k@N0EnKSHJhlA} z-8WUPp95cQR{RWSmvhIjD!)DdzA1QpU*y+n!C>DM{CSvsQ|0=`!mrg5A-}0|ty({K zRBj4h2dJyQ^D~H3d>6dAJ8@Is`eO8ovwnu6+usHLhPrMlT%WP87Og)+#+@Gue=K2d zX1zXfTutdeLnHkk?)d8je>3y-vGZzf`5EjPzGwbBGtEt%>jTr(Nc%Gs-TP(Sy_xZP fkNVa335>rT#hywbAYQ2hFaI1bM|@)Dt9Sne&}kxm diff --git a/truku.py b/truku.py index d7a601c..fd68666 100644 --- a/truku.py +++ b/truku.py @@ -9,6 +9,7 @@ def xlsx轉錄音稿kari(xlsx檔名, kari): 結果 = [] 錄音編號 = None for 篇名, dataframe in 讀xlsx資料(xlsx檔名): + print(篇名) 結果.append(f"【{語料名}-{篇名}】") for 行 in dataframe: if 錄音編號 is not None and 行.錄音編號 != 錄音編號 + 1: @@ -27,6 +28,7 @@ def xlsx轉csv(xlsx檔名, kari, csv檔名): ]) writer.writeheader() for 篇名, dataframe in 讀xlsx資料(xlsx檔名): + print(篇名) for 行 in dataframe: writer.writerow({ '錄音編號': 行.錄音編號, From a21e39630e829056ce0844ed42c8ed56495dae6a Mon Sep 17 00:00:00 2001 From: Tia i X570-ACE Date: Fri, 20 Dec 2024 14:03:37 +0800 Subject: [PATCH 24/26] =?UTF-8?q?=E4=BF=AESonarCloud=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 16 +++++----------- tox.ini | 3 +-- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0114d27..85d6d14 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,23 +32,17 @@ jobs: script: - tox -e shellcheck - name: Test + install: + - pip install tox + script: + - tox -e test + - name: Integration Test service: - docker addons: # For the `SONARQUBE_SCANNER_PARAMS` variable sonarcloud: token: ${SONAR_TOKEN} - install: - - pip install tox - script: - - tox -e test - - > - docker run --rm - -e SONARQUBE_SCANNER_PARAMS - -e SONAR_TOKEN="${SONAR_TOKEN}" - -v "`pwd`:/usr/src" - sonarsource/sonar-scanner-cli - - name: Integration Test install: - pip install tox script: diff --git a/tox.ini b/tox.ini index 7f413e9..6b49d79 100644 --- a/tox.ini +++ b/tox.ini @@ -33,8 +33,7 @@ deps = -rrequirements.txt coverage commands = - coverage run -m unittest {posargs} - coverage xml + python -m unittest {posargs} [testenv:integrationTest] deps = From a984487bae22d08b37a621540a8ec99f532687cc Mon Sep 17 00:00:00 2001 From: Tia i X570-ACE Date: Thu, 2 Jan 2025 14:26:33 +0800 Subject: [PATCH 25/26] =?UTF-8?q?=E7=85=A7=E5=BB=BA=E8=AD=B0=E6=94=B9?= =?UTF-8?q?=E6=AA=94=E5=90=8D=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- truku.py => kari.py | 0 patas.py | 2 +- tests/testPangcah.py | 4 ++-- tests/testSeediq.py | 4 ++-- "tests/test\350\252\236\346\226\231\345\220\215.py" | 2 +- "tests/test\350\275\211csv.py" | 2 +- .../test\350\275\211\351\214\204\351\237\263\347\250\277.py" | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) rename truku.py => kari.py (100%) diff --git a/truku.py b/kari.py similarity index 100% rename from truku.py rename to kari.py diff --git a/patas.py b/patas.py index 52782b7..6095ce3 100644 --- a/patas.py +++ b/patas.py @@ -1,6 +1,6 @@ from argparse import ArgumentParser from pathlib import Path -from truku import xlsx轉錄音稿kari, xlsx轉csv +from kari import xlsx轉錄音稿kari, xlsx轉csv def main(): diff --git a/tests/testPangcah.py b/tests/testPangcah.py index 4a6d47a..f721157 100644 --- a/tests/testPangcah.py +++ b/tests/testPangcah.py @@ -1,7 +1,7 @@ from unittest import TestCase from os.path import join, abspath, dirname -from truku import 找語料名 -from truku import xlsx轉錄音稿kari +from kari import 找語料名 +from kari import xlsx轉錄音稿kari class 語料名試驗(TestCase): diff --git a/tests/testSeediq.py b/tests/testSeediq.py index c72c79a..9001ce7 100644 --- a/tests/testSeediq.py +++ b/tests/testSeediq.py @@ -1,7 +1,7 @@ from unittest import TestCase from os.path import join, abspath, dirname -from truku import 找語料名 -from truku import xlsx轉錄音稿kari +from kari import 找語料名 +from kari import xlsx轉錄音稿kari class 語料名試驗(TestCase): diff --git "a/tests/test\350\252\236\346\226\231\345\220\215.py" "b/tests/test\350\252\236\346\226\231\345\220\215.py" index 5764b8d..77633be 100644 --- "a/tests/test\350\252\236\346\226\231\345\220\215.py" +++ "b/tests/test\350\252\236\346\226\231\345\220\215.py" @@ -1,6 +1,6 @@ from unittest import TestCase from os.path import join, abspath, dirname -from truku import 找語料名 +from kari import 找語料名 class 語料名試驗(TestCase): diff --git "a/tests/test\350\275\211csv.py" "b/tests/test\350\275\211csv.py" index fed54e3..0f5b30b 100644 --- "a/tests/test\350\275\211csv.py" +++ "b/tests/test\350\275\211csv.py" @@ -1,7 +1,7 @@ from unittest import TestCase from os.path import join, abspath, dirname -from truku import xlsx轉csv from csv import DictReader +from kari import xlsx轉csv class xlsx轉csv試驗(TestCase): diff --git "a/tests/test\350\275\211\351\214\204\351\237\263\347\250\277.py" "b/tests/test\350\275\211\351\214\204\351\237\263\347\250\277.py" index d828209..01f2ecd 100644 --- "a/tests/test\350\275\211\351\214\204\351\237\263\347\250\277.py" +++ "b/tests/test\350\275\211\351\214\204\351\237\263\347\250\277.py" @@ -1,6 +1,6 @@ from unittest import TestCase from os.path import join, abspath, dirname -from truku import xlsx轉錄音稿kari +from kari import xlsx轉錄音稿kari class xlsx轉錄音稿試驗(TestCase): From 3c33bc42375cf19786c651a318a274f1965c1a0a Mon Sep 17 00:00:00 2001 From: Tia i X570-ACE Date: Thu, 2 Jan 2025 14:27:24 +0800 Subject: [PATCH 26/26] =?UTF-8?q?=E4=BF=AEREADME.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 18a4c93..89d3b62 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ source venv/bin/activate pip install -r requirements.txt ``` -## 轉錄音稿 +## 轉Truku錄音稿 從Google Sheet下載錄音稿,假設下載後檔名是`1-465|D-TL01-005.xlsx`