I want to analyze some configuration files using the Natural Language tool provided by Google-Cloud-Platform. The problem that I am having is that either you do a loop with Sentences or with the Tokens. Is there any way to make a loop with the sentence and there for map each word with it's corresponding token?
func printSentences(m *languagepb.AnnotateTextResponse) {
sentences := m.GetSentences()
for i,sentence := range sentences {
//HERE I WANT TO MAKE ANOTHER LOOP FOR THE TOKENS IN THIS SENTENCE
fmt.Println(sentence.String())
}
}
There's a function to get the tokens, m.GetTokens() but that's not my solution due to some dependencies in my files to test.