terms

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package terms は用語集の読み取りを担う。

用語集は専用の書式を持たない。ID 付きセクションで書かれた 1 つの文書タイプであり、 見出しの表題が用語、セクション本文の第 1 段落が定義になる。こうすることで 用語も頂点としてグラフに載り、影響範囲・参照整合性・索引がそのまま効く。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Occurrence

type Occurrence struct {
	Term string
	File string
	Line int
}

Occurrence は語の出現 1 件。

func FindTerm

func FindTerm(file, term string, lines []parser.ProseLine) []Occurrence

FindTerm は指定した語を含む行を返す。 探す語は用語集から与えられるので、ここでの判定は照合であって推測ではない。

より長い語の内部への一致(Request の中の Req、非機能要件の中の機能要件)は 拾わない。同じ字種が語の前後へ続くときは複合語の一部とみなす。 深刻度が誤りの判定なので、取りこぼしより誤検出を避ける側に倒す(ARC-8)。

type Set

type Set struct {
	// contains filtered or unexported fields
}

Set は用語集。宣言順を保つ。

func FromDocs

func FromDocs(docs []*parser.Document, glossaryType string) *Set

FromDocs は glossaryType の文書から用語集を組み立てる。

func (*Set) Has

func (s *Set) Has(name string) bool

Has は用語が登録済みかを返す。

func (*Set) IsGlossaryFile

func (s *Set) IsGlossaryFile(path string) bool

IsGlossaryFile はパスが用語集の文書かを返す。

func (*Set) Len

func (s *Set) Len() int

Len は登録された用語の数を返す。

func (*Set) Terms

func (s *Set) Terms() []Term

Terms は用語を宣言順に返す。

type Term

type Term struct {
	ID         string // 識別子(TERM-1)
	Name       string // 見出しの表題(FR)
	Definition string // セクション本文の第 1 段落
	File       string
	Line       int
}

Term は用語 1 件。

func (Term) Aliases

func (t Term) Aliases() []string

Aliases は用語の別表記を返す。

「機能要件 (Functional Requirement)」から「機能要件」と「Functional Requirement」を 取り出す。定義が自由な文章である以上、括弧を含むだけで別表記とみなすと 「この用語は設計 (design) の文脈で使う語である」から「この用語は設計」を拾う。 指摘の深刻度が error なので、取りこぼしより誤検出を避ける側に倒し、 言い換えの形をした第 1 文だけを対象にする。条件は 3 つ。

  • 括弧の後に文が続かない(続くなら言い換えではなく説明)
  • 括弧より前が短い
  • 括弧より前に読点がない

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL