/*
* XXXX を行うプログラム by 自分の名前
* (簡単な機能と使い方)
* $Log: $
*/
/*
* 機能
* HTK 形式のモデルファイルを HMMSet 構造体に読み込む
* 入出力
* O : hmmset 読み込む構造体
* I : filename モデルファイル
* I : modelname モデル名(文字列)
* 返り値
* OK : 0
* ERROR : -1
*/
int LoadSingleModelFile( HMMSet *hmmset, char *filename, char *modelname )
{
(以下、関数の中身)
}
この形式に従えば、javadoc というツールを使って .java ファイルから .html ファイルを 自動生成することができる。
/**
* A class representing a window on the screen.
* For example:
* <pre>
* Window win = new Window(parent);
* win.show();
* </pre>
*
* @author Sami Shaio
* @version %%I%, %%G%
* @see java.awt.BaseWindow
* @see java.awt.Button
*/
class Window extends BaseWindow {
...
}
/**
* The X-coordinate of the window.
*
* @see window#1
*/
int x = 1263732;
/**
* Returns the character at the specified index. An index
* ranges from <code>0</code> to <code>length() - 1</code>.
*
* @param index the index of the desired character.
* @return the desired character.
* @exception StringIndexOutOfRangeException
* if the index is not in the range <code>0</code>
* to <code>length()-1</code>.
* @see java.lang.Character#charValue()
*/
public char charAt(int index) {
...
}
for ( i = 0; i < MAX_ELMTS; i++ )
LeftElmt = Left[ i ];
Left[ i ] = Right[ i ];
Right[ i ] = LeftElmt;
次の例では、行 A で制御機構を開始し、行 D で制御機構を
終了する。ふたつの行の間を直線配置することで視覚的まとまりが
はっきりする。
A ■■■■■■■■■■■■■■■ B ■■■■■■■■■■■ C ■■■■■■■■■■■ D ■■■C 言語でこれを表現すると、次のようになる。 for 文, while 文などでも同様である。
A if ( 条件式 ) {
B ■■■■■■■■■■■
C ■■■■■■■■■■■
D }
参考文献: S.McConnell "コードコンプリート" (Microsoft Press,アスキー出版局)