@pslaw
You had an example with nangailangan, as in nangailangan ako ng kape 'I needed coffee'. Can it be used together with a verb? such as
nangailangan si/ni Bob na magbasa (si Max) ng libro. 'Bob needed (Max) to read a book.'
Remember that “kailangan” is the shortened version of “kailanganin”, an object-focused verb. It may be used with a verb because it can be an auxiliary verb. Remember also that it can function as a the noun “need” too.
“Mangailangan” is a subject-focused verb.
The distinction might be confusing for native English speakers because in English, the verb remains the same regardless of focus. Maybe the difference between “kailangan/kailanganin” and “mangailangan” would be clearer if we define the former as “to need” and the latter, “to be in need of”. So, “kinailangang magbasa ni Max” (Max needed to read) is OK because “kailangan” works as an auxiliary verb there. “Nangailangang magbasa si Max” would not sound right as it is like saying “Max was in need of reading”.
“Nanganilangan si Bob ng magbabasa ng libro” = Bob was in need of/needed someone who will read the book. - The need is for a reader, not the reading.
How do you say 'who needed (Max) to read a book?'
“Who” is “sino” and is the “doer” of “needed”. You will need the subject-focused “mangailangan” for “sino”.
“Sino ang nangailangan na/nangailangang pabasahin si Max ng libro?” = Who was in need of having Max read a book?” = Who needed Max to read a book? (“pabasahin” = to make someone read)
You can use “kailangan”, but it will function as a noun.
“Sino ang MAY kailangan na/kailangang pabasahin si Max ng libro?” = Who HAS/HAD the need to make Max read a book
Are the following examples I made up OK?
kailangan ng titser ang tindahang bilhan ng estudyante ng pagkain. - this sentence would most likely get an “ano?” response again. It translates to “ The teacher needs the store to be bought food from by the students”
'The teacher needs the student to buy food at the shop' = Kailangan ng titser na ang estudyante ay bumili ng pagkain sa tindahan. (This is the correct structure and it agrees with the English structure)
kailangang magbasa ang titser ng libro. = A teacher needs to read books/a book. (needs to do so as a teacher)
kailangan ang titser na magbasa ng libro. - This will be understood as to have the same meaning as the preceding one, but just poorly constructed because “kailangan” is an auxiliary verb to “magbasa”, but “ang titser” is placed between them.
Where does yata fit best? Does it mean 'probably'?
“Yata” may mean “probably”, “I think”, “it seems”, “might”, and other hypothetical terms depending on what would best fit the sentence.
kailangan yata ng titser na bumabasa/magbabasa ng libro. => kailangan yata ng titser na MAGBASA ng libro = It seems that the teacher needs to read books/a book. (Will more likely be understood as the need to read is due to the teacher’s lack of knowledge about something. However, it may also be understood as the teacher just wants to be left alone to be able to read a book. Context is needed.)
kailangan ng titser yatang bumabasa/magbabasa ng libro. => kailangan ng titser yatang MAGBASA ng libro – Means the same thing as the preceding one, but that one sounds more natural.
kailangan yatang bumasa/magbasa ng titser ng libro. => kailangan yatang MAGBASA ng titser ng libro (same meaning as the first one)
kailangang bumasa/magbasa yata ng titser ng libro. - same meaning also, but preceding one sounds more natural.
In the example you gave earlier :
gustong nagluluto ng teacher ng pagkain.
does it mean that the teacher likes the cooking he did in the past? - No. It means that the teacher enjoys cooking food at any time.
“Nagustuhan ng teacher ang niluto niyang pagkain” = The teacher liked the food that he cooked. - This may mean any time in the past.
We have ng teacher here. But it must be ang teacher in nagluluton ang teacher ng pagkain 'the teacher was cooking food'. Is that correct?
“Nagluluto ANG teacher ng pagkain” - This is correct. “Magluto” is subject-focused. “ANG titser ay nagluluto ng pagkain” = “Nagluluto ng pagkain ANG titser” = The teacher is cooking food.
However, if you’d add “gusto” before “nagluluto” (gustong nagluluto), then “ang” will become “ng” because your verb is no longer subject-focused.
The explanation is similar to the one for “kailangan” and “mangailangan” above. “Gusto” is the shortened version of “gustuhin”, an object-focused verb that serves as an auxiliary verb in “gustong nagluluto” - “likes cooking”. Being an object-focused verb, the doer has to take the possessive form – NG titser.
how do you say 'he likes to cook food tomorrow', replace 'nagluluto' with 'magluluto'? - No. Your verb here is “likes to cook” (gustong magluto) and what may be conjugated is “like” and not “to cook”. Since “gusto” (like “kailangan”) is the shortened “gustuhin”, it is used regardless of the actual tense of the verb. Context will determine the tense. So, “he likes to cook food tomorrow” is “gusto niyang magluto ng pagkain bukas”. However, if we will use the actual verb “gustuhin”, then it will have to take the future tense - “gugustuhin niyang magluto ng pagkain bukas” = he would like to cook food tomorrow.
The following example you gave is very interesting:
ang mga estudyante ay gustong ang titser ang magluto ng pagkain.
It has three ang-phrases. Usually, there can be at most one ang-phrase per verb. I venture to guess its literally means something like (awkward English) 'the students want the teacher to be the one who cooks/is cooking food', but then the verb should be magluluto, no? - “Ang” stands for “the” and there are three in - THE students would like THE teacher to be THE ONE to cook the food.