fix typo and format imports (#119)

This commit is contained in:
Zhizhen He 2023-04-05 22:03:45 +08:00 committed by GitHub
parent 6ac9208474
commit 62f415efa3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 17 additions and 11 deletions

View File

@ -3,7 +3,6 @@ package rime
import ( import (
"bufio" "bufio"
"fmt" "fmt"
mapset "github.com/deckarep/golang-set/v2"
"log" "log"
"os" "os"
"path" "path"
@ -12,6 +11,8 @@ import (
"time" "time"
"unicode" "unicode"
"unicode/utf8" "unicode/utf8"
mapset "github.com/deckarep/golang-set/v2"
) )
var specialWords = mapset.NewSet[string]() // 特殊词汇列表,不进行任何检查 var specialWords = mapset.NewSet[string]() // 特殊词汇列表,不进行任何检查

View File

@ -3,13 +3,14 @@ package rime
import ( import (
"bufio" "bufio"
"fmt" "fmt"
mapset "github.com/deckarep/golang-set/v2"
"log" "log"
"os" "os"
"regexp" "regexp"
"strings" "strings"
"time" "time"
"unicode/utf8" "unicode/utf8"
mapset "github.com/deckarep/golang-set/v2"
) )
var emojiTXT = "/Users/dvel/Library/Rime/opencc/emoji.txt" var emojiTXT = "/Users/dvel/Library/Rime/opencc/emoji.txt"

View File

@ -2,11 +2,12 @@ package rime
import ( import (
"bufio" "bufio"
mapset "github.com/deckarep/golang-set/v2"
"log" "log"
"os" "os"
"sort" "sort"
"strings" "strings"
mapset "github.com/deckarep/golang-set/v2"
) )
// SortEnDict 排序 en.dict.yaml 词库 // SortEnDict 排序 en.dict.yaml 词库

View File

@ -5,7 +5,6 @@ import (
"crypto/sha1" "crypto/sha1"
"encoding/hex" "encoding/hex"
"fmt" "fmt"
mapset "github.com/deckarep/golang-set/v2"
"io" "io"
"log" "log"
"os" "os"
@ -13,6 +12,8 @@ import (
"strconv" "strconv"
"strings" "strings"
"time" "time"
mapset "github.com/deckarep/golang-set/v2"
) )
// 一个词条的组成部分 // 一个词条的组成部分

View File

@ -3,8 +3,6 @@ package rime
import ( import (
"bufio" "bufio"
"fmt" "fmt"
"github.com/commander-cli/cmd"
mapset "github.com/deckarep/golang-set/v2"
"io" "io"
"log" "log"
"net/http" "net/http"
@ -15,9 +13,12 @@ import (
"strings" "strings"
"time" "time"
"unicode/utf8" "unicode/utf8"
"github.com/commander-cli/cmd"
mapset "github.com/deckarep/golang-set/v2"
) )
var fileterMark = "# *_*" // "# *_*" 和 mark 之间是过滤词列表 var filterMark = "# *_*" // "# *_*" 和 mark 之间是过滤词列表
var filterList = mapset.NewSet[string]() // 过滤词列表,在这个列表里的词汇,不再写入 var filterList = mapset.NewSet[string]() // 过滤词列表,在这个列表里的词汇,不再写入
// UpdateSogou 更新搜狗流行词 // UpdateSogou 更新搜狗流行词
@ -62,7 +63,7 @@ func makeSogouFilterList() {
break break
} }
if !isFilterMark { if !isFilterMark {
if strings.Contains(line, fileterMark) { if strings.Contains(line, filterMark) {
isFilterMark = true isFilterMark = true
} }
continue continue

View File

@ -3,7 +3,6 @@ package rime
import ( import (
"bufio" "bufio"
"fmt" "fmt"
mapset "github.com/deckarep/golang-set/v2"
"log" "log"
"os" "os"
"path" "path"
@ -11,6 +10,8 @@ import (
"strconv" "strconv"
"strings" "strings"
"time" "time"
mapset "github.com/deckarep/golang-set/v2"
) )
// Sort 词库排序,顺便去重 // Sort 词库排序,顺便去重