2020-09-23 03:06:43 +00:00
|
|
|
import { Context, Recogniser } from "./encoding";
|
2020-03-30 03:42:04 +00:00
|
|
|
|
|
|
|
export interface Match {
|
|
|
|
confidence: number;
|
|
|
|
name: string;
|
2020-09-23 03:06:43 +00:00
|
|
|
lang?: string;
|
2020-03-30 03:42:04 +00:00
|
|
|
}
|
|
|
|
|
2021-10-19 10:21:29 +00:00
|
|
|
export default (ctx: Context, rec: Recogniser, confidence: number): Match => ({
|
2020-05-07 23:06:28 +00:00
|
|
|
confidence,
|
2021-10-19 10:21:29 +00:00
|
|
|
name: rec.name(ctx),
|
|
|
|
lang: rec.language ? rec.language() : undefined,
|
2020-03-30 03:42:04 +00:00
|
|
|
});
|