Skip to content

Commit

Permalink
Merge pull request #106 from tychy/fix-94
Browse files Browse the repository at this point in the history
Fix #94
  • Loading branch information
tychy authored Jul 15, 2024
2 parents e3fbdbf + 1e46d67 commit be51927
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions toukibo/parse_body.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,12 +352,22 @@ func (h *HoujinBody) ConsumeHoujinBankruptedAt(s string) bool {
}

func (h *HoujinBody) ConsumeHoujinDissolvedAt(s string) bool {
if !strings.Contains(s, "┃解 散") {
return false
}

var s2 string
for _, p := range extractLines(s) {
_, b, _ := splitThree(p)
s2 += b
}

// ex 北海道知事の命令により解散
// ex 会社法472条第1項の規定により解散
pattern := fmt.Sprintf("┃解 散 *│ *([%s]+日)([%s]*)により解散", ZenkakuStringPattern, ZenkakuStringPattern)
pattern := fmt.Sprintf("([%s]+日)([%s]*)により解散", ZenkakuStringPattern, ZenkakuStringPattern)
regex := regexp.MustCompile(pattern)

matches := regex.FindStringSubmatch(s)
matches := regex.FindStringSubmatch(s2)
if len(matches) > 0 {
h.HoujinDissolvedAt = ZenkakuToHankaku(strings.TrimSpace(matches[1]))
return true
Expand Down

0 comments on commit be51927

Please sign in to comment.