Skip to content

Commit 67a8bb3

Browse files
committed
fix Fbl
1 parent d21bbe4 commit 67a8bb3

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

src/apps/FoxBreatheLabeler/util/FblThread.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ namespace FBL {
1414
m_outTgPath(std::move(outTgPath)), ap_threshold(ap_threshold), ap_dur(ap_dur), sp_dur(sp_dur) {
1515
}
1616

17-
struct Phone {
17+
struct Phoneme {
1818
double start, end;
1919
std::string text;
2020
};
2121

2222
struct Word {
2323
double start{}, end{};
2424
std::string text;
25-
QList<Phone> phones;
25+
QList<Phoneme> phones;
2626
};
2727

2828
static std::vector<std::pair<float, float>>
@@ -99,7 +99,7 @@ namespace FBL {
9999
ifs >> textgrid;
100100

101101
const auto wordIntervals = textgrid.GetTierAs<textgrid::IntervalTier>("words")->GetAllIntervals();
102-
const auto phonesIntervals = textgrid.GetTierAs<textgrid::IntervalTier>("phones")->GetAllIntervals();
102+
const auto phonesIntervals = textgrid.GetTierAs<textgrid::IntervalTier>("phonemes")->GetAllIntervals();
103103

104104

105105

@@ -116,9 +116,9 @@ namespace FBL {
116116
const double wordStart = interval.min_time;
117117
const double wordEnd = interval.max_time;
118118

119-
for (const auto &phone : phonesIntervals) {
120-
if (phone.min_time >= wordStart && phone.max_time <= wordEnd)
121-
wordsDict[interval.min_time].phones.append(Phone{phone.min_time, phone.max_time, phone.text});
119+
for (const auto &phoneme : phonesIntervals) {
120+
if (phoneme.min_time >= wordStart && phoneme.max_time <= wordEnd)
121+
wordsDict[interval.min_time].phones.append(Phoneme{phoneme.min_time, phoneme.max_time, phoneme.text});
122122
}
123123
}
124124

@@ -181,23 +181,23 @@ namespace FBL {
181181
textgrid::TextGrid outTg(0.0, wordCursor);
182182

183183
auto tierWords = std::make_shared<textgrid::IntervalTier>("words", 0.0, wordCursor);
184-
auto tierPhones = std::make_shared<textgrid::IntervalTier>("phones", 0.0, wordCursor);
184+
auto tierPhonemes = std::make_shared<textgrid::IntervalTier>("phonemes", 0.0, wordCursor);
185185

186186
for (const auto &[start, end, text, phones] : out) {
187187
tierWords->AppendInterval(textgrid::Interval(start, end, text));
188188

189189
if (text == "SP" || text == "AP") {
190-
tierPhones->AppendInterval(textgrid::Interval(start, end, text));
190+
tierPhonemes->AppendInterval(textgrid::Interval(start, end, text));
191191
continue;
192192
}
193193

194194
for (const auto &[start, end, text] : phones) {
195-
tierPhones->AppendInterval(textgrid::Interval(start, end, text));
195+
tierPhonemes->AppendInterval(textgrid::Interval(start, end, text));
196196
}
197197
}
198198

199199
outTg.AppendTier(tierWords);
200-
outTg.AppendTier(tierPhones);
200+
outTg.AppendTier(tierPhonemes);
201201

202202
QFile outFile(m_outTgPath);
203203
if (outFile.open(QIODevice::WriteOnly | QIODevice::Text)) {

0 commit comments

Comments
 (0)