|
119 | 119 | (when confidence-explanations {:confidence-explanations confidence-explanations}))))
|
120 | 120 |
|
121 | 121 | ; Generic GNU family word regexes
|
122 |
| -(def ^:private gnu-words [#"\(?The" #"GNU" #"GPL" #"Genere?al" #"Pub?lic" #"Licen[cs]ed?(?:[\s\-–—]+Under)?" #"Open[\s\-–—]+Source" #"FOSS" #"OSS"]) |
| 122 | +(def ^:private gnu-words [#"The" #"GNU" #"GPL" #"Genere?al" #"Pub?lic" #"Licen[cs]ed?(?:[\s\-–—]+Under)?" #"Open[\s\-–—]+Source" #"FOSS" #"OSS"]) |
123 | 123 |
|
124 | 124 | ; AGPL regexes
|
125 |
| -(def ^:private fre-agpl-words (re/grp (apply re/alt (concat gnu-words [#"\(?AGPL[\s\-–—v\d\.]*\)?" "Affero"])))) |
| 125 | +;####TEST!!!! |
| 126 | +;(def ^:private fre-agpl-words (re/grp (apply re/alt (concat gnu-words [#"\(?AGPL[\s\-–—v\d\.]*\)?" "Affero"])))) |
| 127 | +(def ^:private fre-agpl-words-before (re/grp (apply re/alt (concat gnu-words [#"\(?AGPL[\s\-–—]*\)?" "Affero"])))) |
| 128 | +(def ^:private fre-agpl-words-after (re/grp (apply re/alt (concat gnu-words [#"\(?AGPL[\s\-–—v\d\.]*\)?" "Affero"])))) ; Only include version variants *after* the actual version |
126 | 129 | (def re-agpl (re/join #"(?iuUx)(?<!\w)" ; Only public for ease of testing
|
127 | 130 | "\n\n#### Leading word salad ####\n"
|
128 |
| - (re/zom-grp fre-agpl-words lcir/fre-mws) |
| 131 | + (re/zom-grp fre-agpl-words-before lcir/fre-mws) |
129 | 132 | "\n\n#### Matching words ####\n"
|
130 |
| - (re/ncg "agpl" #"(?:A\s?GPL|Affero)") |
| 133 | + (re/ncg "agpl" #"(?:A[\s\-–—]*GPL|Affero)") |
131 | 134 | "\n\n#### Pre-version word salad ####\n"
|
132 |
| - (re/zom-grp lcir/fre-mws fre-agpl-words) |
| 135 | + (re/zom-grp lcir/fre-mws fre-agpl-words-before) |
133 | 136 | "\n\n#### Version and version qualifier ####\n"
|
134 | 137 | (re/opt-grp lcir/fre-ows lcir/fre-version)
|
135 | 138 | (re/opt-grp lcir/fre-ows lcir/fre-only-or-later)
|
136 | 139 | "\n\n#### Post-version word salad ####\n"
|
137 |
| - (re/zom-grp lcir/fre-mws fre-agpl-words) |
| 140 | + (re/zom-grp lcir/fre-mws fre-agpl-words-after) |
138 | 141 | "\n\n#### Date ####\n"
|
139 | 142 | (re/opt-grp lcir/fre-mws lcir/fre-date)
|
140 | 143 | "\n\n#### Coda ####\n"
|
141 | 144 | #"(?!\w)"))
|
142 | 145 |
|
143 | 146 | ; LGPL regexes
|
144 | 147 | (def ^:private fre-lesser-or-library (re/or-grp "Lesser" "Library" (re/join lcir/fre-mws "or" lcir/fre-mws)))
|
145 |
| -(def ^:private fre-lgpl-words (re/grp (apply re/alt (concat gnu-words [#"\(?LGPL[\s\-–—v\d\.]*\)?" fre-lesser-or-library])))) |
| 148 | +;####TEST!!!! |
| 149 | +;(def ^:private fre-lgpl-words (re/grp (apply re/alt (concat gnu-words [#"\(?LGPL[\s\-–—v\d\.]*\)?" fre-lesser-or-library])))) |
| 150 | +(def ^:private fre-lgpl-words-before (re/grp (apply re/alt (concat gnu-words [#"\(?LGPL[\s\-–—]*\)?" fre-lesser-or-library])))) |
| 151 | +(def ^:private fre-lgpl-words-after (re/grp (apply re/alt (concat gnu-words [#"\(?LGPL[\s\-–—v\d\.]*\)?" fre-lesser-or-library])))) ; Only include version variants *after* the actual version |
146 | 152 | (def re-lgpl (re/join #"(?iuUx)(?<!\w)" ; Only public for ease of testing
|
147 | 153 | "\n\n#### Leading word salad ####\n"
|
148 |
| - (re/zom-grp fre-lgpl-words lcir/fre-mws) |
| 154 | + (re/zom-grp fre-lgpl-words-before lcir/fre-mws) |
149 | 155 | "\n\n#### Matching words ####\n"
|
150 | 156 | (re/ncg "lgpl"
|
151 |
| - (re/alt #"L\s*GPL" |
| 157 | + (re/alt #"L[\s\-–—]*GPL" |
152 | 158 | (re/join #"(?:GNU|GPL)" lcir/fre-mws fre-lesser-or-library)
|
153 | 159 | (re/join fre-lesser-or-library lcir/fre-mws #"(?:GNU|GPL|General)")))
|
154 | 160 | "\n\n#### Pre-version word salad ####\n"
|
155 |
| - (re/zom-grp lcir/fre-mws fre-lgpl-words) |
| 161 | + (re/zom-grp lcir/fre-mws fre-lgpl-words-before) |
156 | 162 | "\n\n#### Version and version qualifier ####\n"
|
157 | 163 | (re/opt-grp lcir/fre-ows lcir/fre-version)
|
158 | 164 | (re/opt-grp lcir/fre-ows lcir/fre-only-or-later)
|
159 | 165 | "\n\n#### Post-version word salad ####\n"
|
160 |
| - (re/zom-grp lcir/fre-mws fre-lgpl-words) |
| 166 | + (re/zom-grp lcir/fre-mws fre-lgpl-words-after) |
161 | 167 | "\n\n#### Date ####\n"
|
162 | 168 | (re/opt-grp lcir/fre-mws lcir/fre-date)
|
163 | 169 | "\n\n#### Coda ####\n"
|
164 | 170 | #"(?!\w)"))
|
165 | 171 |
|
166 | 172 | ; GPL regexes
|
167 |
| -(def ^:private fre-gpl-words (re/grp (apply re/alt (concat gnu-words [#"\(?GPL[\s\-–—v\d\.]*\)?"])))) |
| 173 | +;####TEST!!!! |
| 174 | +;(def ^:private fre-gpl-words (re/grp (apply re/alt (concat gnu-words [#"\(?GPL[\s\-–—v\d\.]*\)?"])))) |
| 175 | +(def ^:private fre-gpl-words-before (re/grp (apply re/alt (concat gnu-words [#"\(?GPL[\s\-–—]*\)?"])))) |
| 176 | +(def ^:private fre-gpl-words-after (re/grp (apply re/alt (concat gnu-words [#"\(?GPL[\s\-–—v\d\.]*\)?"])))) ; Only include version variants *after* the actual version |
168 | 177 | (def re-gpl (re/join #"(?iuUx)(?<!\w)" ; Only public for ease of testing
|
169 | 178 | "\n\n#### Leading word salad ####\n"
|
170 |
| - (re/zom-grp fre-gpl-words lcir/fre-mws) |
| 179 | + (re/zom-grp fre-gpl-words-before lcir/fre-mws) |
171 | 180 | "\n\n#### Matching words ####\n"
|
172 | 181 | (re/ncg "gpl" #"(?:GNU|GPL|(?:Genere?al(?:[\s\-–—]+Pub?lic)?(?:[\s\-–—]+Licen[cs]e)?))")
|
173 | 182 | "\n\n#### Pre-version word salad ####\n"
|
174 |
| - (re/zom-grp lcir/fre-mws fre-gpl-words) |
| 183 | + (re/zom-grp lcir/fre-mws fre-gpl-words-before) |
175 | 184 | "\n\n#### Version and version qualifier ####\n"
|
176 | 185 | (re/opt-grp lcir/fre-ows lcir/fre-version)
|
177 | 186 | (re/opt-grp lcir/fre-ows lcir/fre-only-or-later)
|
178 | 187 | "\n\n#### Post-version word salad ####\n"
|
179 |
| - (re/zom-grp lcir/fre-mws fre-gpl-words) |
| 188 | + (re/zom-grp lcir/fre-mws fre-gpl-words-after) |
180 | 189 | "\n\n#### Date ####\n"
|
181 | 190 | (re/opt-grp lcir/fre-mws lcir/fre-date)
|
182 | 191 | "\n\n#### Coda ####\n"
|
|
0 commit comments