MCPcopy Index your code
hub / github.com/apache/answer / parseQuestionID

Method parseQuestionID

internal/service/search_parser/search_parser.go:304–319  ·  view source on GitHub ↗

parseQuestionID check whether specified question's id

(query *string)

Source from the content-addressed store, hash-verified

302
303// parseQuestionID check whether specified question's id
304func (sp *SearchParser) parseQuestionID(query *string) (questionID string) {
305 var (
306 q = *query
307 expr = `inquestion:(\d+)`
308 )
309
310 re := regexp.MustCompile(expr)
311 res := re.FindStringSubmatch(q)
312 if len(res) == 2 {
313 questionID = res[1]
314 q = re.ReplaceAllString(q, "")
315 }
316
317 *query = strings.TrimSpace(q)
318 return
319}
320
321// parseIsAnswer check the result if only limit answer or not
322func (sp *SearchParser) parseIsAnswer(query *string) (isAnswer bool) {

Callers 1

ParseStructureMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected