/go-clc

Golang Chinese Library Classification (CLC; **图书馆分类法) Search Tool

Primary LanguageGoMIT LicenseMIT

go-clc

GoDev Go

Golang Chinese Library Classification (CLC; **图书馆分类法) Search Tool

All classification data were collected from wikipedia.

《**图书馆分类法》各种版本及其管理系统的知识产权归国家图书馆所有。http://clc.nlc.cn

Installation

go get -u github.com/sunshineplan/go-clc

License

The MIT License (MIT)

Example code

package main

import (
	"log"

	"github.com/sunshineplan/go-clc"
)

func main() {
	results := clc.SearchByCaption("计算机技术")
	log.Print(results) // [{TP 自动化技术、计算机技术} {TP3 计算技术、计算机技术}]

	result, err := clc.SearchByNotation("TP3")
	if err != nil {
		log.Fatal(err)
	}
	log.Print(result)            // {TP3 计算技术、计算机技术}
	log.Print(result.String())   // TP3 计算技术、计算机技术
	log.Print(result.TopClass()) // {T 工业技术}
	log.Print(result.Classes())  // [{T 工业技术} {TP 自动化技术、计算机技术} {TP3 计算技术、计算机技术}]
}