spdx.matching
License matching functionality, primarily provided by org.spdx.utility.compare.LicenseCompareHelper
.
exceptions-within-text
(exceptions-within-text text)
(exceptions-within-text text exception-ids)
Returns the set of ids for all exceptions found in text
(optionally limited to just the provided set of exception-ids
), or nil
if none were found.
Note: this method has a substantial performance cost. Callers are encouraged to break their ids into batches and call the 2-arg version with each batch in parallel (e.g. using clojure.core/pmap
), then merge the results.
init!
(init!)
Initialises this namespace upon first call (and does nothing on subsequent calls), returning nil
. Consumers of this namespace are not required to call this fn, as initialisation will occur implicitly anyway; it is provided to allow explicit control of the cost of initialisation to callers who need it.
Note: this method may have a substantial performance cost.
licenses-within-text
(licenses-within-text text)
(licenses-within-text text license-ids)
Returns the set of ids for all licenses found in text
(optionally limited to just the provided set of license-ids
), or nil
if none were found.
Note: this method has a substantial performance cost. Callers are encouraged to break their ids into batches and call the 2-arg version with each batch in parallel (e.g. using clojure.core/pmap
), then merge the results.
text-contains-exception?
(text-contains-exception? text exception-id)
Does the text
contain the exception identified by exception-id
somewhere within it?
text-contains-license?
(text-contains-license? text license-id)
Does the text
contain the license identified by license-id
somewhere within it?
text-is-exception?
(text-is-exception? text exception-id)
Does the entire text
match the exception identified by exception-id
?
text-is-license?
(text-is-license? text license-id)
Does the entire text
match the license identified by license-id
?
texts-equivalent-exceptions?
(texts-equivalent-exceptions? text1 text2)
Does text1
and text2
represent an equivalent exception?
texts-equivalent-licenses?
(texts-equivalent-licenses? text1 text2)
Does text1
and text2
represent an equivalent license?