From e3f52802057fe2c53d18fb3cbeed578cd0dbef0c Mon Sep 17 00:00:00 2001 From: Tyler Nickerson Date: Sat, 20 Jan 2024 16:26:44 -0800 Subject: [PATCH] fix(print): fix formatting --- cli/go.mod | 2 +- cli/go.sum | 2 +- cli/print.go | 4 ++-- lib/search/go.sum | 1 - 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cli/go.mod b/cli/go.mod index 67c36986..4b438cd4 100644 --- a/cli/go.mod +++ b/cli/go.mod @@ -21,7 +21,7 @@ require ( github.com/RoaringBitmap/roaring v1.2.3 // indirect github.com/bits-and-blooms/bitset v1.2.0 // indirect github.com/blevesearch/bleve/v2 v2.3.10 // indirect - github.com/blevesearch/bleve_index_api v1.1.4 // indirect + github.com/blevesearch/bleve_index_api v1.1.5 // indirect github.com/blevesearch/geo v0.1.18 // indirect github.com/blevesearch/go-porterstemmer v1.0.3 // indirect github.com/blevesearch/gtreap v0.1.1 // indirect diff --git a/cli/go.sum b/cli/go.sum index 756dd692..e05351eb 100644 --- a/cli/go.sum +++ b/cli/go.sum @@ -8,7 +8,7 @@ github.com/TheOpenDictionary/odict/lib/types v0.0.0-20231024210539-d4e83ae7bfdc github.com/TheOpenDictionary/odict/lib/utils v0.0.0-20231024210539-d4e83ae7bfdc h1:oVwda5G0bJrj/NYI2GbDlOjbU1CqduXFjTSzSwwjNSk= github.com/bits-and-blooms/bitset v1.2.0 h1:Kn4yilvwNtMACtf1eYDlG8H77R07mZSPbMjLyS07ChA= github.com/blevesearch/bleve/v2 v2.3.10 h1:z8V0wwGoL4rp7nG/O3qVVLYxUqCbEwskMt4iRJsPLgg= -github.com/blevesearch/bleve_index_api v1.1.4 h1:n9Ilxlb80g9DAhchR95IcVrzohamDSri0wPnkKnva50= +github.com/blevesearch/bleve_index_api v1.1.5 h1:0q05mzu6GT/kebzqKywCpou/eUea9wTKa7kfqX7QX+k= github.com/blevesearch/geo v0.1.18 h1:Np8jycHTZ5scFe7VEPLrDoHnnb9C4j636ue/CGrhtDw= github.com/blevesearch/go-porterstemmer v1.0.3 h1:GtmsqID0aZdCSNiY8SkuPJ12pD4jI+DdXTAn4YRcHCo= github.com/blevesearch/gtreap v0.1.1 h1:2JWigFrzDMR+42WGIN/V2p0cUvn4UP3C4Q5nmaZGW8Y= diff --git a/cli/print.go b/cli/print.go index 3c7b1244..35966277 100644 --- a/cli/print.go +++ b/cli/print.go @@ -22,7 +22,7 @@ var fmtNoteTitle = color.New(color.Underline, color.Bold).SprintfFunc() var fmtPartOfSpeech = color.New(color.Italic).SprintfFunc() var fmtEntry = color.New(color.Bold).SprintfFunc() -var parentheticalRegex = regexp.MustCompile(`^(\(.*?\))`) +var parentheticalRegex = regexp.MustCompile(`^(\(.*?\)\s*)`) type PrintFormat = string @@ -132,7 +132,7 @@ func printSense(sense types.SenseRepresentable, entry types.EntryRepresentable) func printEty(ety types.EtymologyRepresentable, i int, showTitle bool, entry types.EntryRepresentable) { if showTitle { - fmt.Printf("%s\n", fmtEtymology("Etymology #%d", i+1)) + fmt.Printf("%s\n\n", fmtEtymology("Etymology #%d", i+1)) } if len(ety.Description) > 0 { diff --git a/lib/search/go.sum b/lib/search/go.sum index 58eb2bf7..f59ca51e 100644 --- a/lib/search/go.sum +++ b/lib/search/go.sum @@ -14,7 +14,6 @@ github.com/bits-and-blooms/bitset v1.2.0 h1:Kn4yilvwNtMACtf1eYDlG8H77R07mZSPbMjL github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/blevesearch/bleve/v2 v2.3.10 h1:z8V0wwGoL4rp7nG/O3qVVLYxUqCbEwskMt4iRJsPLgg= github.com/blevesearch/bleve/v2 v2.3.10/go.mod h1:RJzeoeHC+vNHsoLR54+crS1HmOWpnH87fL70HAUCzIA= -github.com/blevesearch/bleve_index_api v1.1.4 h1:n9Ilxlb80g9DAhchR95IcVrzohamDSri0wPnkKnva50= github.com/blevesearch/bleve_index_api v1.1.5 h1:0q05mzu6GT/kebzqKywCpou/eUea9wTKa7kfqX7QX+k= github.com/blevesearch/bleve_index_api v1.1.5/go.mod h1:PbcwjIcRmjhGbkS/lJCpfgVSMROV6TRubGGAODaK1W8= github.com/blevesearch/geo v0.1.18 h1:Np8jycHTZ5scFe7VEPLrDoHnnb9C4j636ue/CGrhtDw=