| 539 | } |
| 540 | |
| 541 | static void build_deco_vec(const char *props_json, cbm_sem_vec_t *out) { |
| 542 | memset(out, 0, sizeof(*out)); |
| 543 | if (!props_json) { |
| 544 | return; |
| 545 | } |
| 546 | char *decos[CBM_SZ_16]; |
| 547 | int dc = json_str_array(props_json, "decorators", decos, CBM_SZ_16); |
| 548 | for (int i = 0; i < dc; i++) { |
| 549 | cbm_sem_vec_t ri; |
| 550 | cbm_sem_random_index(decos[i], &ri); |
| 551 | cbm_sem_vec_add_scaled(out, &ri, PSE_UNIT_POS); |
| 552 | free(decos[i]); |
| 553 | } |
| 554 | cbm_sem_normalize(out); |
| 555 | } |
| 556 | |
| 557 | static void decode_struct_profile(const char *props_json, float *out) { |
| 558 | memset(out, 0, sizeof(float) * CBM_AST_PROFILE_DIMS); |
no test coverage detected