ZHUOWARE BACKYARD TOP|ZHUOWARE表ページ

Software Study Notes to CSV Converter

May 11, 2013 SSNCSV 1.2 / ssn2csv 1.8 / lib/SSNScan 1.2
Mar. 31, 2013 SSNCSV 1.1 / ssn2csv 1.7 / lib/SSNScan 1.1
Aug. 31, 2012 SSNCSV 1.0 / ssn2csv 1.6 / lib/SSNScan 1.0
by: zhuo http://zhuoware.blog110.fc2.com/

最新リリース情報 // Latest Release

May 11, 2013版をリリースします.次の変更がありました.
  1. 各エントリの開始行に加え,最終行も取得する.
// The latest release May 11, 2013 allows you to:
  1. The last line of each entry, as well as the first line, can be now obtained.
Mar. 31, 2013版をリリースします.次のことができるようになりました.
  1. 元のhtmlファイルにおける各エントリの行番号を取得する.
  2. エープリルフールのお楽しみ: 色選択機能.
// The latest release Mar. 31, 2013 allows you to:
  1. get the line number in the original html file for each entry , and
  2. have April Fool Fun: Color selection functionality.

はじめに // Outline

SSNCSVパッケージを使うと,zhuowareの「ソフトウェアまとめ」の内容を,CSV (コンマ で区切られたテキスト)形式で入手することができます. //
SSNCSV package allows you to obtain the contents of "Software Study Notes" in CSV (comma separated values) format.

Disclaimer

  • 本ツールは個人的な実験の結果をご紹介するものにすぎません.ドキュメントは最小限であり,テストもほとんどしていません.ご使用は,パッケージ内容をご理解できる方のみ,at your own riskでお願いいたします.ツールのご使用により生じた結果については一切責任を負いません.
  • 各種法令および製品使用許諾条項の遵守をお願いいたします.
  • Vocaloid製品に関係される各社様および関係各方面から,本ツール,ないし関連情報の公開について中止の要請があった場合には,ただちに公開を中止いたします.その場合には,このページで告知いたします.
  • The executables and documents simply describe the result of personal experiments. The executables are not tested, or the documents are less than necessary. Only those who understand what you are doing precisely may use this tool at your own risk. The author is not responsible to any damages or losses brought about by the use of this package.
  • The users are kindly requested to comply with all the applicable laws and the license agreements.
  • If any of the right-holders requested to terminate the disclosure of this tool and related information, the author would immediately shut down the related Web contents. In that case the author will announce the termination at this page.

ダウンロード // download

パッケージはこちらからダウンロードできます:
//
The package can be downloaded here.

説明 // Description

最新パッケージには次のものが含まれます:
//
The package consists of the following components:
SSNCSV_12.exe
Windows用のGUIアプリケーションです.
単に起動して,クリックしてCSVファイル名を指定するだけで,ネット越しに「ソフトウェアまとめ」を取り込んでそのCSVファイルを得ることができます.
//
A GUI application for Windows.
Just launch, click and give a CSV filename to get the CSV version of "Software Study Notes" locally over the network.
SSNCSV_12.tcl
上記の実行形式と機能は同一ですが,こちらはTcl/Tkスクリプト版です.ですので,Linux, Mac OSなどの別のプラットフォームでも実行できるかもしれません (が,未確認です.テキストのエンコーディングを修正しないといけないかもしれません.レポートお待ちします).
//
This is identical to the executable version above, but this is a Tcl/Tk script version--- which means it could run on other platforms such as Linux and Mac OS (not tested yet - Text encodings may need to be fixed. Please report!).
ssn2csv_18.tcl
コマンドライン版のTclスクリプトです(Tkを使いません).
htmlファイル software_study.html を,CSVファイルに変換します.このhtmlファイルは,前もって自分で手元にダウンロードしておく必要があります.
ダウンロードにはダウンロードツールをお使いください;Webブラウザのsave機能で保存したhtmlファイルはほとんどの場合書式が変わってしまっており,正しく解析できません.
Rev. 1.7 では-i optionが指定可能です: これを指定すると,行番号を出力に含めます.指定しない場合は,出力には行番号は含まれず,Rev.1.6と同一の結果が得られます.
Rev. 1.8では加えて-b optionも指定可能です: これを指定すると,各エントリの末尾行番号を出力に含めます.
//
A command-line based Tcl script (that is, no Tk used) that converts software_study.html to a CSV file, The html file must be downloaded to your local machine in advance.
For the download, be sure to use a download tool, since the files saved using "save" functionality in web browsers are in most cases modified and can not be parsed appropriately.
Rev. 1.7 takes -i option : when specified, the line numbers will be included in the output. otherwise the result will be identical to that from Rev. 1.6, without line numbers.
Rev. 1.8 additionally takes -b option : when specified, the line numbers for the end of each entry section will be included in the output.
lib/SSNScan1.2
「ソフトウェアまとめ」のテキストを解析して,結果をTclのリストのリストに格納する Tcl拡張です.APIの詳細については,上記ssn2csv_18.tcl をご覧ください.
//
A Tcl extension that parses the texts of "software_study.html" to genarate a list of list as a result. For the detailed API usage, see ssn2csv_18.tcl described above.
  1. まず,SSNScannerのインスタンスを次のようにしてつくります:
    //
    You are to first create an instance of SSNScanner by:
    		package require SSNScan
    		set s [SSNScanner \#auto]
    
  2. putLineNumberコマンドを使うと,行番号を出力に含めるようスキャナに指定することができます:
    //
    You can tell the scanner to include the line numbers in the output by putLineNumber command:
                                                 Beginning  End
    		$s putLineNumber 0      ;  off        off  (Rev.1.0)
    		$s putLineNumber none   ;  off        off  (Rev.1.0)
    		$s putLineNumber 1      ;  on         off  (Rev.1.1)
    		$s putLineNumber top    ;  on         off  (Rev.1.1)
    		$s putLineNumber end    ;  off        on   new in 1.2
    		$s putLineNumber both   ;  on         on   new in 1.2
    
    これを実行しない場合,スキャナは行番号を出力に含めず,出力結果はRev. 1.0のものと同一になります.
    //
    Otherwise the scanner will NOT include the line numbers and the output will be identical to that from Rev. 1.0.
  3. それからインスタンスにテキストを読ませます.対象としては,ファイル名,ファイルディスクリプタ,テキスト行のTclリストのうち一つが選べます.つまり次のどれかを書くことになります.
    //
    And then to let it parse texts from the source specified by one of the filename, the file descriptor, or the Tcl list of text lines; That is, you are to write:
    		$s readFromFile $filename
    	or:
    		$s readFromFileDesc $fd
    	or: 
    		$s readFromList $textlist
    
  4. 得られるTclリストのリストは,インスタンス内に保持されますので,次のようにして取り出します:
    //
    The resulting Tcl list of list is stored inside the instance, which can be retrieved by:
    		set list [$s getResult]
    
お試しください!
//
Have fun,
zhuo