Welcome,
There is a typo in your signature:
setReturnSegmen(true)
First of all make sure you are first initializing the OEPocketsphinxController object as explained in the docs, and then set these to true for the OEPocketsphinxController shared object:
setReturnSegments(returnSegments: Bool)
setReturnSegmentTimes(returnSegmentTimes: Bool)
and after initializing the OEEventsObserver object, making sure that you are making its protocol available as described in the Swift tutorial first (and making OEEventsObserver+RapidEars available in your bridging header), use the callback:
rapidEarsDidDetectFinishedSpeech(asWordArray words: [Any]!, andScoreArray scores: [Any]!)
If you’d like more troubleshooting, please show the relevant code from your app, and also the logging output as described in the post how to troubleshoot and provide logging info here where you can see how to turn on and share the logging that provides troubleshooting information for this kind of issue.