Documentation ¶
Overview ¶
Licensed to Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Apache Software Foundation (ASF) licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Licensed to Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Apache Software Foundation (ASF) licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func CommentIndicatorNormalizer(text string) string
- func FlattenSpaceNormalizer(text string) string
- func Identify(content string) (string, error)
- func Normalize(license string) string
- func NormalizeHeader(header string) string
- func NormalizePattern(pattern string) string
- func OneLineNormalizer(text string) string
- func SubstantiveTextsNormalizer(text string) string
- func VariablesNormalizer(text string) string
- type Normalizer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommentIndicatorNormalizer ¶
CommentIndicatorNormalizer trims the leading characters of comments, such as /*, <!--, --, (*, etc..
func FlattenSpaceNormalizer ¶
FlattenSpaceNormalizer flattens continuous spaces into a single space.
func Normalize ¶
Normalize applies a chain of Normalizers to the license text to make it cleaner for identification.
func NormalizeHeader ¶
NormalizeHeader applies a chain of Normalizers to the file header to make it cleaner for identification.
func NormalizePattern ¶
NormalizePattern applies a chain of Normalizers to the license pattern to make it cleaner for identification.
func OneLineNormalizer ¶
OneLineNormalizer simply removes all line breaks to flatten the license text into one line.
func SubstantiveTextsNormalizer ¶
SubstantiveTextsNormalizer normalizes the license text by substituting some words that doesn't change the meaning of the license.
func VariablesNormalizer ¶
VariablesNormalizer replace the variables actual value into variable name.