Commit b8cb5e18 authored by LiberIT's avatar LiberIT

fixed a part of paragraph text quote encoding

parent 47070f62
Pipeline #119704594 failed with stages
in 6 minutes and 16 seconds
ba
be
bi
bo
bu
ca
ce
ci
co
cu
da
de
di
do
du
fa
fe
fi
fo
fu
ga
ge
gi
go
gu
ja
je
ji
jo
ka
ke
ki
ko
ku
la
le
li
lo
lu
ma
me
mi
mo
mu
na
ne
ni
no
nu
pa
pe
pi
po
pu
qa
qe
qi
qo
ra
re
ri
ro
ru
sa
se
si
so
su
ta
te
ti
to
tu
va
ve
vi
wa
we
wi
wo
wu
xa
xe
xi
xo
xu
ya
ye
yi
yo
yu
za
ze
zi
zo
......@@ -514,7 +514,8 @@ struct Phrase fyakyi_hwuska_dva2ttu(struct Phrase phrase, struct Text text) {
const uint phrase_vacancy = phrase.page.plength*LINE_LONG - phrase.begin;
guarantee(phrase_vacancy >= text.length);
repeat(text.length,
DEBUGPRINT(("%c\n", text.letters[iterator]));
DEBUGPRINT(("%c, %X, %X iterator\n", text.letters[iterator],
text.letters[iterator], iterator));
phrase =
addenda_theLetter_toThePhrase(text.letters[iterator], phrase);
);
......
......@@ -541,7 +541,11 @@ extern void convert_last_number_to_quote(uint16_t *terminator_indexFinger,
if (letter_number < NUMBER_WORD_SEQUENCE_LONG) { // if found
// DEBUGPRINT(("0x%X number detected 0x%X\n", letter_number,
// number_word));
number |= (uint64_t)(letter_number << number_indexFinger * 4);
//number |= (uint64_t)(letter_number << number_indexFinger * 4);
number += letter_number * number_exponent(DEFAULT_NUMBER_BASE,
number_indexFinger);
DEBUGPRINT(("%X letter_number, %X number_indexFinger, %X number\n",
letter_number, number_indexFinger, number));
++number_indexFinger;
} else {
finish = TRUE;
......@@ -972,6 +976,8 @@ struct Phrase encode_paragraph_quote(struct Phrase phrase, struct Text text,
// delete the trailing verb words we no longer needed
// addenda declarative_mood_GRAMMAR
addenda_theGrammarWord_toThePhrase(declarative_mood_GRAMMAR, phrase);
//DEBUGPRINT(("%X length, phrase.length %X \n", length, phrase.length));
phrase = round_thePhrase_toRoofLine(phrase);
text_print(text);
Page_print(phrase.page);
// #TODO
......@@ -985,13 +991,17 @@ struct Phrase encode_paragraph_quote(struct Phrase phrase, struct Text text,
*text_indexFinger = full_quote.letters+full_quote.length - full_quote.letters;
struct Text quote_contents = find_letter_quote_contents(full_quote);
text_print(quote_contents);
DEBUGPRINT(("%X phrase.length, %X phrase.begin\n", phrase.length, phrase.begin));
phrase.begin -= phrase.begin % LINE_LONG_MASK;
guarantee(phrase.begin % LINE_LONG_MASK == 0);
phrase = addenda_theText_toThePhrase(quote_contents, phrase);
phrase_print(phrase);
Page_print(phrase.page);
phrase_print(phrase);
}
//
//
//DEBUGPRINT(("%X length, phrase.length %X \n", length, phrase.length));
phrase = round_thePhrase_toRoofLine(phrase);
//DEBUGPRINT(("%X length, phrase.length %X \n", length, phrase.length));
phrase.length += length;
//DEBUGPRINT(("%X length, phrase.length %X \n", length, phrase.length));
phrase = round_thePhrase_toRoofLine(phrase);
......
......@@ -25,3 +25,8 @@ uint64_t number_xor(uint64_t acc, uint64_t ins) {
uint64_t number_neg(uint64_t acc) {
return ~acc;
}
uint64_t number_exponent(uint64_t acc, uint64_t ins) {
uint64_t produce = 1;
repeat(ins, produce *= acc);
return produce;
}
......@@ -6,5 +6,6 @@ uint64_t number_subtract(uint64_t acc, uint64_t ins);
uint64_t number_multiply(uint64_t acc, uint64_t ins);
uint64_t number_divide(uint64_t acc, uint64_t ins);
uint64_t number_xor(uint64_t acc, uint64_t ins);
uint64_t number_exponent(uint64_t acc, uint64_t ins);
uint64_t number_neg(uint64_t acc);
#endif
......@@ -4166,7 +4166,7 @@ const char *quiz_paragraph_quote_encoding_2() {
return 0;
}
const char *quiz_paragraph_quote_encoding_1() {
NewTextPhrase(input, 10, "hnimgina ksaszrondo lyatkyitksuh "
NewTextPhrase(input, 10, "hnimgina hsipzrondo lyatkyitksuh "
"zi.prih."
"The goal is not to be better than the other man, but your previous self.\n"
"-- Dalai Lama"
......@@ -4178,26 +4178,26 @@ const char *quiz_paragraph_quote_encoding_1() {
mu_assert("", input.page.lines[0][2] == name_GRAMMAR);
mu_assert("", input.page.lines[0][3] == nominative_case_GRAMMAR);
mu_assert("", input.page.lines[0][4] == PARAGRAPH_LETTER_QUOTE);
mu_assert("", input.page.lines[0][5] == 0x40);
mu_assert("", input.page.lines[0][5] == 0x70);
mu_assert("", input.page.lines[0][6] == declarative_mood_GRAMMAR);
mu_assert("", input.page.lines[1][0] == 'T');
mu_assert("", input.page.lines[1][1] == 'h');
mu_assert("", input.page.lines[5][1] == paragraph_GRAMMAR);
DEBUGPRINT(("%X input.length\n", input.length));
mu_assert("", input.length >= 0x31);
NewTextPhrase(compare_phrase, 4, "hnimgina tyutzrondo lyatkyitksuh prah");
mu_assert("", phrase_to_phrase_compare(input, compare_phrase));
Page_print(compare_phrase.page);
mu_assert("", phrase_letters_compare(compare_phrase,
"zi.prih."
"The goal is not to be better than the other man, but your previous self.\n"
"To conquer oneself is a greater victory than to conquer thousands in a battle.\n"
"My religion is very simple. My religion is kindness.\n"
"The roots of all goodness lie in the soil of appreciation for goodness.\n"
"-- Dalai Lama"
".prih.ziprah"
) == truth_WORD);
text_phrase_print(input);
// DEBUGPRINT(("%X input.length\n", input.length));
// mu_assert("", input.length >= 0x31);
// NewTextPhrase(compare_phrase, 4, "hnimgina tyutzrondo lyatkyitksuh prah");
// mu_assert("", phrase_to_phrase_compare(input, compare_phrase));
// Page_print(compare_phrase.page);
// mu_assert("", phrase_letters_compare(compare_phrase,
// "zi.prih."
// "The goal is not to be better than the other man, but your previous self.\n"
// "To conquer oneself is a greater victory than to conquer thousands in a battle.\n"
// "My religion is very simple. My religion is kindness.\n"
// "The roots of all goodness lie in the soil of appreciation for goodness.\n"
// "-- Dalai Lama"
// ".prih.ziprah"
// ) == truth_WORD);
// text_phrase_print(input);
return 0;
}
const char *quiz_paragraph_quote_encoding_null() {
......@@ -4263,7 +4263,7 @@ const char *quiz_paragraph_quote_encoding() {
mu_run_quiz(quiz_addenda_theLetter_toThePhrase);
mu_run_quiz(quiz_addenda_theText_toThePhrase);
TODO(mu_assert("#TODO quiz_paragraph_quote_encoding_1", 1==0));
//mu_run_quiz(quiz_paragraph_quote_encoding_1);
mu_run_quiz(quiz_paragraph_quote_encoding_1);
// mu_run_quiz(quiz_paragraph_quote_encoding_null);
return 0;
}
......
......@@ -185,13 +185,13 @@ int _tablet_print(const uint8_t sequence_long, const line_t *tablet) {
int print_gross = 0;
uint8_t indexFinger = 0;
for (; indexFinger < sequence_long; ++indexFinger) {
if (tablet[indexFinger][0] == 0) {
printf("\t0x(0) ");
// break;
} else {
//if (tablet[indexFinger][0] == 0) {
// printf("\t0x(0) ");
// // break;
//} else {
printf("\t");
print_gross = line_t_print(tablet[indexFinger]);
}
//}
}
printf("\n");
return print_gross;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment