Difference between revisions of "অপের্তিউম নতুন ভাষা জোড়া তে হয় কিভাবে"

From Apertium
Jump to navigation Jump to search
(Translating Apertium New Language Pair HOWTO into Bengali- in progress)
Line 160: Line 160:
 
$ lt-comp lr apertium-sh-en.sh.dix sh-en.automorf.bin
 
$ lt-comp lr apertium-sh-en.sh.dix sh-en.automorf.bin
 
</pre>
 
</pre>
  +
ের আউটপুট কি তৈরি করা উচিত:
Should produce the output:
 
 
<pre>
 
<pre>
 
main@standard 12 12
 
main@standard 12 12
 
</pre>
 
</pre>
  +
আমরা হিসেবে ডানদিকতে এইটি সঙ্কলন করছি ছেড়ে চলে যাচ্ছি, আমরা উৎপাদন করা একটি বিশ্লেষক 'reই। আসুন একটি উৎ‍পাদক খুব তৈরি করি।
As we are compiling it left to right, we're producing an analyser. Lets make a generator too.
 
 
<pre>
 
<pre>
 
$ lt-comp rl apertium-sh-en.sh.dix sh-en.autogen.bin
 
$ lt-comp rl apertium-sh-en.sh.dix sh-en.autogen.bin
Line 182: Line 182:
 
আপনার ডিরেক্টরীতে দুই ফাইল এখন থাকা উচিত:
 
আপনার ডিরেক্টরীতে দুই ফাইল এখন থাকা উচিত:
   
  +
* apertium-sh-en.sh.dix একটি কোন ধারণ করে (খুব) মৌলিক সের্ব-ক্রাতিয়ান মর্ফলোগিকাল শব্দভাণ্ডার, এবং
* apertium-sh-en.sh.dix which contains a (very) basic Serbo-Croatian morphological dictionary, and
 
  +
* apertium-sh-en.en.dix একটি কোন ধারণ করে (খুব) মৌলিক ইংরেজী মর্ফলোগিকাল শব্দভাণ্ডার।
* apertium-sh-en.en.dix which contains a (very) basic English morphological dictionary.
 
   
 
===দুই ভাষা শব্দভাণ্ডার===
 
===দুই ভাষা শব্দভাণ্ডার===

Revision as of 00:45, 30 November 2010

অপের্তিউম নতুন ভাষা জোড়া তে হয় কিভাবে

এই তে হয় কিভাবে ডকুমেন্টটি বর্ণনা করবে শুরু হচ্ছে থেকে অপের্তিউম মেশিন অনুবাদ পদ্ধতির জন্য একটি নতুন ভাষা জোড়া শুরু করতে কিভাবে।

এইটি ভাষাএর যেকোন জ্ঞান ধরে নেয় না, অথবা হের মেশিন অনুবাদ স্তর উপরে ক্রিয়াপদ থেকে nouns আলাদা করতে সক্ষম (এবং প্রেপসিতীয়নস ইত্যাদি)

ভূমিকা

প্রেপসিতীয়নস , আপনি হিসেবে, একটি মেশিন অনুবাদ পদ্ধতি এখনের মধ্যে সম্ভবত রিয়ালিজে কোর্স ছে। ভাল, সম্পূর্ণভাবে না, এইটি একটি মেশিন অনুবাদ প্ল্যাটফর্ম 'sয়। এইটি একটি ইঞ্জিন এবং সরঞ্জামের বাক্স জোগান দেয় যে আপনার নিজের মেশিন অনুবাদ সিস্টেম নির্মাণ করতে আপনাকে অনুমোদন করে। কেবল জিনিস আপনি ডেটা কর হ লেখতে প্রয়োজন বোধ করেন। ডেটা একটি মৌলিক স্তরে, গঠিত হয়, তিন অভিধান এবং একটি অল্প নিয়মের (কথা পুনরায় ধারাচ্ছে এবং অন্যান্য ব্যাকরণগত stuffএর সঙ্গে চুক্তিতে)।ের দিকে একটি আরও বেশি পুঙ্খানুপুঙ্খ ভূমিকার জন্য যেমন এইটি সমস্ত কাজ করে, ে কিছু সর্বোৎকৃষ্ট কাগজ আছে প্রকাশনা পাতা।

আপনি প্রয়োজন বোধ করবেন

  • lttoolbox (>= 3.0.0)
  • libxml utils (xmllint etc.)
  • apertium (>= 3.0.0)
  • একটি লেখা সম্পাদক (অথবা একটি স্পেচিয়ালিসেদ এক্সএমএল সম্পাদক যদি আপনি পছন্দ করে)

এই ডকুমেন্টটি বর্ণনা করবে না এই প্যাকেজ ইনস্টল করতে কিভাবে, আরও বেশি তথ্য দয়া করের জন্য অপের্তিউম ওয়েবসাইটের ডকুমেনটেশন অংশ দেখে।

ের দ্বারা গঠিত একটি ভাষা জোড়া কি করে?

অপের্তিউম একটি অগভীর স্থানান্তর ধরন মেশিন অনুবাদ পদ্ধতি। সুতরাং, এইটি অভিধান এবং অগভীর স্থানান্তর নিয়মে প্রাথমিকভাবে কাজ করে। অপারেশনে, অগভীর স্থানান্তর সেই এইটি পূর্ণ সিন্তাচ্তিক পার্সিং টিতে গভীর স্থানান্তর থেকে আলাদা করা হয় না, নিয়ম পার্স গাছগুলি ক্রিয়াকর্মের চেয়ে লেক্সাল একক, বরংএর দলে ক্রিয়াকর্ম সাধারণভাবে আছে। একটি মৌলিক স্তরে, তিন প্রধান অভিধান আছে:

  1. ভাষা xxএর জন্য মর্ফলোগিকাল শব্দভাণ্ডার: এইটি ের নিয়ম ধারণ করে ভাষা xxতে যেমন শব্দ ইন্ফ্লেচ্ত ওয়া হয়। আমাদের উদাহরণ এইতেটি ডাক দেওয়া হবে: apertium-sh-en.sh.dix
  2. ভাষা yyএর জন্য ইন্ফ্লেচ্ত শব্দভাণ্ডার: এইটি ের নিয়ম ধারণ করে ভাষা yyতে যেমন শব্দ ইন্ফ্লেচ্ত ওয়া হয়। আমাদের উদাহরণ এইতেটি ডাক দেওয়া হবে: apertium-sh-en.en.dix
  3. দুই ভাষা শব্দভাণ্ডার: দুই ভাষাতে শব্দ এবং চিহ্নের মধ্যে যোগাযোগ ধারণ করে। আমাদের উদাহরন এইতেটি ডাক দেওয়া হবে: apertium-sh-en.sh-en.dix

একটি অনুবাদ জোড়াতে, উভয় ভাষা অনুবাদের জন্য হয় উৎ‍স অথবা লক্ষ্য, এইগুলি আপেক্ষিক শর্তাবলী আছে। স্থানান্তর নিয়মের জন্য ও দুই ফাইল আছে। এইগুলি নিয়ম আছে যে শাসন করে যেমন শব্দ বাক্য, উদাঃ chat noir -> cat black -> black cat. এইটি লিঙ্গের চুক্তি ও শাসন করে, সংখ্যা ইত্যাদি নিয়ম ভিতরে ঢোকেতে ও ব্যবহার করা যাবে অথবা লেক্সাল পদগুলো মুছে ফেলুন, হিসেবে হ বর্ণনা কর পরবর্তী কালে। এই ফাইল আছে:

  • ভাষা yy স্থানান্তর নিয়মে ভাষা xx: এই ফাইলটি ের জন্য নিয়ম ধারণ করে যেমন ভাষা xx ভাষা yyএর দিকে পরিবর্তন করা হবে। আমাদের উদাহরণ এইতেটি হবে: apertium-sh-en.sh-en.t1x
  • ভাষা স্থানান্তর নিয়ম xxতে ভাষা yy: এই ফাইলটি ের জন্য নিয়ম ধারণ করে যেমন ভাষা yy ভাষা xxএর দিকে পরিবর্তন করা হবে। আমাদের উদাহরণ এইতেটি হবে: apertium-sh-en.en-sh.t1x

ভাষা জোড়া বর্তমানে প্রাপ্তিসাধ্য আছে অন্যান্য ফাইলের অনেক, কিন্তু আমরা তাদেরকে এখানে ঢাকা দিই না। এই ফাইল একটি কাজ করছে পদ্ধতি উৎ‍পাদন করতে কেবল এক প্রয়োজন বোধ করে।

ভাষা জোড়া

হিসেবে ফাইল নামগুলোর দ্বারা রাখ হ পরক্ষভাবে উল্লেখ কর প্রতি, এই হোতোটি ব্যাখ্যা করতে সের্ব-ক্রাতিয়ান থেকে ইংরেজী অনুবাদ করার উদাহরণ ব্যবহার করবে একটি মৌলিক পদ্ধতি তৈরি করতে কিভাবে। এইটি একটি আদর্শ জোড়া নয়, পদ্ধতি থেকে আরও বেশি কাছাকাছি সম্পর্কিত ভাষার জন্য ভাল কাজ করে। এইটির সহজ উদাহরণের জন্য একটি সমস্যা এখানে উপস্থাপন করা উচিত নয় দিয়েছিল।

শর্তাবলী একটি সংক্ষিপ্ত নোট

শর্তাবলীর সংখ্যা আছে যে আমরার পূর্বে হ বুঝতে প্রয়োজন বোধ করবেন চালিয়ে যাবেন। প্রথম lemmaচ্ছে। একটি lemma একটি কথার উদ্ধৃতি আকার। এইটি যেকোন ব্যাকরণগত তথ্যের কথা টুকরায়। উদাহরণের জন্য, কথা বিড়ালের lemma বিড়ালচ্ছে। ইংরেজী নৌনস এইতেটি প্রশ্নে কথার একবচন আকার সাধারণভাবে হবে। ক্রিয়াপদের জন্য, lemma তে ইন্ফিনিতিভে টুকরা এরয়, wasএর উদাঃ lemma be হবে। দ্বিতীয় symbolচ্ছে। অপের্তিউম পদ্ধতির প্রসঙ্গে, চিহ্ন একটি ব্যাকরণগত লেবেলে উল্লেখ করে। কথা বিড়াল একটি প্লুরাল নৌনস, এইটি অতএবের নৌনস চিহ্ন এবং প্লুরাল চিহ্ন থাকবে। অপের্তিউম মডিউল এইের ইনপুট এবং আউটপুটেগুলি কোণ বন্ধনীর মধ্যে typically দেওয়া হয়, অনুসরণ কর হিসেবে:

  • <n>; for নৌনস।
  • <pl>; for প্লুরাল।

চিহ্নের অন্যান্য উদাহরণ আছে <sg>; একবচন, <p1> প্রথম ব্যক্তি, <pri> বর্তমান ইন্দিকাতিভে, ইত্যাদি। কোণ বন্ধনীতে কখন লিখিত, চিহ্ন ট্যাগ হিসেবে ও উল্লেখ করা হয়ত যাবে। এইটি বর্তমানে প্রাপ্তিসাধ্য ভাষা জোড়া চিহ্ন সংজ্ঞা অক্রন্য্ম্সএর অনেকে মূল্যবান লক্ষ্য কর সেটাচ্ছে অথবা কাতালানতে শব্দের সঙ্কোচন। উদাহরণ,এর জন্য vbhaver — থেকে vb (verb) এবং haver ("to have" কাতালানতে). চিহ্ন তে সংজ্ঞায়িত করা হয় <sdef> ট্যাগ এবং তে ব্যবহার করেছিল <s> ট্যাগ.

তৃতীয় কথা পারাদিগ্মচ্ছে। Apertium পদ্ধতির প্রসঙ্গে, পারাদিগ্ম ের একটি উদাহরণে উল্লেখ করে শব্দের যেমন একটি নির্দিষ্ট শ্রেণী ইন্ফ্লেচ্তয়। মর্ফলোগিকাল শব্দভাণ্ডারে, lemmas (উপরে দেখুন) পারাদিগ্ম্সsতে সংযোগ করা হয় যে বর্ণনা করতে আমাদেরকে অনুমোদন করেন ব্যতীত যেমন একটি প্রদত্ত lemma ইন্ফ্লেচ্ত্সএর শেষাংশের সমস্ত লেখ বাইরিতে রাখ প্রতি।

এইের উপযোগীতার একটি উদাহরণটি, যদি আমরা দুই বিশেষণ এবং lazy সংরক্ষণ করতে চেয়েছিল happyেছিল, একই জিনিসের দুই অনেক সংরক্ষণ করার পরিবর্তে:

  • happy, happ (y, ier, iest)
  • lazy, laz (y, ier, iest)

আমরা একটি সহজভাবে সংরক্ষণ করতে পারি, এবং তারপর বলুন "lazy, inflects like happy", অথবা বাস্তবিকপক্ষে "shy inflects like happy", "naughty inflects like happy", "friendly inflects like happy" এই উদাহরণে, ইত্যাদিটি, সুখী পারাদিগ্ম হবে,ের জন্য মডেল যেমন অন্যান্য ইন্ফ্লেচ্তয়।ের যথাযত বর্ণনা যেমন এইটি সল্প সময়ে সংজ্ঞায়িত করা হয় ব্যাখ্যা করা হয়। পারাদিগ্ম্স তে সংজ্ঞায়িত করা হয় <pardef> ট্যাগ, তে এবং ব্যবহৃত <par> ট্যাগ।

আরম্ভকৃত পাচ্ছে

মনলিন্গুয়াল অভিধান

See also: List of dictionaries and Incubator

আসুন আমাদের প্রথম উৎ‍স ভাষা শব্দভাণ্ডার তৈরি করার মধ্যে শুরু করি। শব্দভাণ্ডার একটি এক্সএমএল ফাইল। আগুন উপর আপনার লেখা সম্পাদক এবং নিম্নলিখিত টাইপ করুন:

<?xml version="1.0" encoding="UTF-8"?>
<dictionary>

</dictionary>

সুতরাং, ফাইল এখনও পর্যন্ত সংজ্ঞায়িত করে যে আমরা একটি শব্দভাণ্ডার শুরু করতে চাই। হতে এইটির জন্য অর্ডারে কার্যকর, আমরা কিছু আরও বেশি এন্ট্রি যোগ করতে প্রয়োজন বোধ করে, প্রথম একটি বর্ণমালা। এইটি চিঠির সেট সংজ্ঞায়িত করে যে সের্ব-ক্রাতিয়ানএর জন্য শব্দভাণ্ডার,তে ব্যবহার করা হয়ত যাবে। এইটি নিম্নলিখিতের মত কিছু জিনিষ দেখবে, সের্ব-ক্রাতিয়ান বর্ণমালার ধারণ করে সমস্ত চিঠি:

<alphabet>ABCČĆDDžĐEFGHIJKLLjMNNjOPRSŠTUVZŽabcčćddžđefghijklljmnnjoprsštuvzž</alphabet>

ের নিচে স্থান বর্ণমালা <dictionary> ট্যাগ।

পরবর্তী আমরা কিছু চিহ্ন সংজ্ঞায়িত করতে প্রয়োজন বোধ করি। আসুন সহজ জিনিষ, নুনএর সঙ্গে শুরু কর বন্ধই (এন) একবচনে (sg) এবং প্লুরাল (pl)।

<sdefs>
   <sdef n="n"/>
   <sdef n="sg"/>
   <sdef n="pl"/>
</sdefs>

চিহ্ন নামগুলো হতে না ঘটনাতে সুতরাং ক্ষুদ্র,, তাদেরকে পূর্ণে মাত্র লেখ বাইরে যাবে, কিন্তু আপনি হিসেবে টাইপ করা তাদেরকে অনেক হবেন, এইটি সংক্ষিপ্ত করতে বোধ তৈরি করেন।

দুর্ভাগ্যবশত, এইটি সম্পূর্ণভাবে নয় সংখ্যা মাত্রের চেয়ে আরও বেশির জন্য সের্ব-ক্রাতিয়ান ইন্ফ্লেচ্ততে সুতরাং সহজ, নৌনস, তারা লিঙ্গ এবং খাপের জন্য ও ইন্ফ্লেচ্তয়। উপরন্তু, আমরা এই উদাহরণটির উদ্দ্যেশ্যের জন্য ধরে নেব যে নুন মাস্কালিনে এবং নমিনাতিভে খাপে (একটি পূর্ণ উদাহরণ এই ডকুমেন্টটির খুঁজে পা at এই শেষ হা হয়ত যাবে)।

পরবর্তী জিনিস পারাদিগ্ম্স,এর জন্য একটি অংশ সংজ্ঞায়িত করতে

<pardefs>

</pardefs>

এবং একটি শব্দভাণ্ডার অংশ:

<section id="main" type="standard">

</section>

অনুচ্ছেদের দুই ধরন আছে, প্রথম একটি মান অংশ, যে শব্দ, এন্চ্লিতিচ্স ধারণ করে, ইত্যাদি দ্বিতীয় ধরন একটি inconditional section বিরাম চিহ্ন কোন সাধারণভাবে ধারণ করে, ইত্যাদি আমাদের একটি শর্তাধীন অংশ এখানে নেই।

সুতরাং, আমাদের ফাইলের ের মত কিছু জিনিষ এখন দেখা উচিত:

<?xml version="1.0" encoding="UTF-8"?>
<dictionary>
   <sdefs>
     <sdef n="n"/>
     <sdef n="sg"/>
     <sdef n="pl"/>
   </sdefs>
   <pardefs>

   </pardefs>
   <section id="main" type="standard">

   </section>
</dictionary>

আমরা এখন স্থানে কাঠামো পেয়েছি, আমরা একটি নুন যোগ করার মধ্যে শুরু করতে পারি। প্রশ্নে নুন 'gramofon' হবে (যেটি 'gramophone' অথবা 'record player' অভিপ্রায় করে)।

প্রথম জিনিস আমরা করতে প্রয়োজন বোধ করি, আমাদের হিসেবে কোনও আগের পারাদিগ্ম্স নেই, একটি পারাদিগ্ম সংজ্ঞায়িত করতে।

স্মরণ করুন, আমরা ধরে নিয়ে পুরুষ লিঙ্গ এবং নমিনাতিভে খাপ 'reই। নুনএর একবচন আকার 'gramofon'চ্ছে, এবং প্লুরাল 'gramofoni'চ্ছে। সুতরাং:

<pardef n="gramofon__n">
   <e><p><l/><r><s n="n"/><s n="sg"/></r></p></e>
   <e><p><l>i</l><r><s n="n"/><s n="pl"/></r></p></e>
</pardef>

নোট: '<l/>' (তে সমতুল্য <l></l>) অভিপ্রায় করে যে একবচনের জন্য স্টেমতে হ যোগ করতে কোনও অতিরিক্ত পদার্থ নেই।

এইটি এইটি বর্ণনা করার একটি বরং শব্দবহুল মৌখিক রাস্তার মত মনে হতে পারে, কিন্তু এইের জন্য কারণটি আছে এবং এইটি দ্বিতীয় প্রকৃতি তাড়াতাড়ি হয়। আপনি সম্ভবত 'reন ভাবেন যার <e>,

, <l> এবং <r> ের জন্য দাঁড়ান। ভাল,

  • e, এন্ট্রি কির জন্য।
  • p, জোড়া কির জন্য।
  • l, বাম জন্য।
  • r, অধিকার কির জন্য।

কেন বাকি আছে এবং অধিকার? ভাল, মর্ফলোগিকাল অভিধান ফিনিতে দেশ মেশিনের দিকে পরবর্তী কালে সঙ্কলন করা হবে। শব্দ থেকে বিশ্লেষণ ডানদিক তৈরি করতে তাদেরকে সঙ্কলন করছিল ছেড়ে চলে যাচ্ছিল, বিশ্লেষণ থেকে শব্দ ছেড়ে চলে যা তৈরি করতে অধিকার থেকে এবং। উদাহরণের জন্য:

* gramofoni (left to right) gramofon<n><pl> (analysis)
* gramofon<n><pl> (right to left) gramofoni (generation)

আমরা এখন একটি পারাদিগ্ম সংজ্ঞায়িত করেছি, আমরা এর লেম্মা, gramofonতে এইটি সংযোগ করতে প্রয়োজন বোধ করি। আমরা এই inটি অংশ রাখি যে আমরা সংজ্ঞায়িত করেছি।

তে রাখতে এন্ট্রি <অংশ> ের মত দেখবে:

<e lm="gramofon"><i>gramofon</i><par n="gramofon__n"/></e>

শব্দসংক্ষেপে একটি দ্রুত চল নিচে:

  • lm, লেম্মা কির জন্য।
  • i, পরিচয় কির জন্য (বাকি আছে এবং অধিকার একই আছে)।
  • par, পারাদিগ্ম কির জন্য।

এই এন্ট্রিটি কথা, গ্রামোফোন, মূল, গ্রামোফোনএর লেম্মা রাজ্যয় এবংের সঙ্গে পারাদিগ্ম যেটি এইটি গ্রামোফোন ইন্ফ্লেচ্ত্সয়। লেম্মা এবং মূলের মধ্যে পার্থক্য যে লেম্মা কথার উদ্ধৃতি আকার, মূলার সময় তে লেম্মাএর সুব্স্ত্রিং যেটি স্তেম্স যোগ করা হয়। এইটি আরও বেশি পরিষ্কার পরবর্তী কালে হবে যখন আমরা একটি এন্ট্রি দেখায় যেখানে দুই আলাদা আছে।

আমরা শব্দভাণ্ডার পরীক্ষা করতে এখন তৈরি 'reই। এইটি সংরক্ষণ করুন, এবং তারপর শেলে ফেরত। এইটি সঙ্কলন করতে আমরা প্রথম প্রয়োজন (lt-compএর সঙ্গে), তারপর আমরা এইটি পরীক্ষা করতে পারি (lt-procএর সঙ্গে)।

$ lt-comp lr apertium-sh-en.sh.dix sh-en.automorf.bin

ের আউটপুট কি তৈরি করা উচিত:

main@standard 12 12

আমরা হিসেবে ডানদিকতে এইটি সঙ্কলন করছি ছেড়ে চলে যাচ্ছি, আমরা উৎপাদন করা একটি বিশ্লেষক 'reই। আসুন একটি উৎ‍পাদক খুব তৈরি করি।

$ lt-comp rl apertium-sh-en.sh.dix sh-en.autogen.bin

এই দশাতেটি, কমান্ডের একই আউটপুট তৈরি করা উচিত।

আমরা এইগুলি এখন পরীক্ষা করতে পারি। বিশ্লেষকে চল lt-proc।

$ lt-proc sh-en.automorf.bin

গ্রামফনিতে এইটি বাইরে, ধরন এখন চেষ্টা করে (gramophones), এবং আউটপুট দেখুন:

^gramofoni/gramofon<n><pl>$

ইংরেজী শব্দভাণ্ডার,এর জন্য, এখন একই জিনিস করে, কিন্তু গ্রামোফোনএর জন্য ইংরেজী কথা গ্রামোফোনে বিকল্পন, এবং প্লুরাল ইন্ফ্লেচ্তীয়ন পরিবর্তন করুন। আরও বেশি সঠিক কথা 'record player' ব্যবহার করতে কি যদি আপনাকে চাই? ভাল, আমরা ব্যাখ্যা করব করতে কিভাবে যে পরবর্তী কালে।

আপনার ডিরেক্টরীতে দুই ফাইল এখন থাকা উচিত:

  • apertium-sh-en.sh.dix একটি কোন ধারণ করে (খুব) মৌলিক সের্ব-ক্রাতিয়ান মর্ফলোগিকাল শব্দভাণ্ডার, এবং
  • apertium-sh-en.en.dix একটি কোন ধারণ করে (খুব) মৌলিক ইংরেজী মর্ফলোগিকাল শব্দভাণ্ডার।

দুই ভাষা শব্দভাণ্ডার

আমাদের সুতরাং দুই ভাষা শব্দভাণ্ডার তৈরি কর হতে দুই মর্ফলোগিকাল অভিধান, পরবর্তী জিনিস এখন রয়েছে। এইটি শব্দের মধ্যে মাপ্পিন্গ্স বর্ণনা করে। সমস্ত অভিধান একই ফরম্যাট ব্যবহার করে (যেটি ডিটিডি, dix ডিটিডিতে উল্লেখ করা হয়)।

একটি নতুন ফাইল, তৈরি করুন apertium-sh-en.sh-en.dix এবং মৌলিক কাঠামো যোগ করুন:

<?xml version="1.0" encoding="UTF-8"?>
<dictionary>
   <alphabet/>
   <sdefs>
     <sdef n="n"/>
     <sdef n="sg"/>
     <sdef n="pl"/>
   </sdefs>

   <section id="main" type="standard">

   </section>
</dictionary>

আমরা এখন দুই শব্দের মধ্যে অনুবাদ করতে একটি এন্ট্রি যোগ করতে প্রয়োজন বোধ করি।ের মত কিছু জিনিষ:

<e><p><l>gramofon<s n="n"/></l><r>gramophone<s n="n"/></r></p></e>
কারণ অনেক এই এন্ট্রি আছে, তারা ফাইলের সহজতর পড়া সুবিধাজনক করতে একটি লাইনে সাধারণভাবে লিখিত 'reয়। 'l' এবং 'r' অধিকারের সঙ্গে পুনরায়? ভাল, আমরা সের্ব-ক্রাতিয়ান → ইংরেজী শব্দভাণ্ডার তৈরি করতে ডানদিকতে এইটি সঙ্কলন করেছিলাম ছেড়ে চলে গিয়েছিলাম, ইংরেজী → সের্ব-ক্রাতিয়ান শব্দভাণ্ডার তৈরি করতে ছেড়ে চলে যেতে এবং অধিকার।

সুতরাং, এই একবারটি করা হয়, নিম্নলিখিত র্নিদেশাবলী চালান:

$ lt-comp lr apertium-sh-en.sh.dix sh-en.automorf.bin
$ lt-comp rl apertium-sh-en.en.dix sh-en.autogen.bin

$ lt-comp lr apertium-sh-en.en.dix en-sh.automorf.bin
$ lt-comp rl apertium-sh-en.sh.dix en-sh.autogen.bin

$ lt-comp lr apertium-sh-en.sh-en.dix sh-en.autobil.bin
$ lt-comp rl apertium-sh-en.sh-en.dix en-sh.autobil.bin

মর্ফলোগিকাল অনাল্য্সের্স উৎ‍পাদন করতে (automorf), মর্ফলোগিকাল উৎ‍পাদক (autogenেছিল) এবং কথা দৃষ্টিপাত উপর (autobil), বিল ের জন্য " bilingual "।

স্থানান্তর নিয়ম

সুতরাং, আমাদের এখন দুই মর্ফলোগিকাল অভিধান রয়েছে, এবং একটি দুই ভাষা শব্দভাণ্ডার। সমস্ত সেটা আমরা নৌনসএর জন্য একটি স্থানান্তর রুল এখন প্রয়োজন বোধ করে। স্থানান্তর রুল ফাইলের তাদের নিজের ডিটিডি রয়েছে (স্থানান্তর ডিটিডি) যেটি অপের্তিউম প্যাকেজে খুঁজে পা যাবে। যদি আপনি অন্যান্য ভাষা জোড়া প্রথমের রুল ফাইলে দেখতে একটি রুল এইটি একটি ভাল ধারনা বাস্তবায়ন করতে প্রায়শই প্রয়োজন বোধ করেন। অনেক নিয়ম ভাষার মধ্যে রেচ্য়্চ্লেদ/রেউসেদ যাবে। হের নিচে উদাহরণ একটি বর্ণনাকৃতের জন্য যেকোন ফাঁকা বিষয় ভাষার জন্য কার্যকর।

একটি মৌলিক কাঠামোর সঙ্গে সমস্ত অন্যান্যের মত শুরু করুন:

<?xml version="1.0" encoding="UTF-8"?>
<transfer>

</transfer>

মূহুর্তে, কারণ আমরা একটি রুল তৈরি করতে উপেক্ষা করছে খাপ, আমরা প্রয়োজন মাত্র 'reই যে ব্যাকরণগত চিহ্ন ইনপুট এবং আউটপুট তাদেরকে পুনরায় গ্রহণ করি।

শ্রেণীবিভাগ এবং বৈশিষ্ট্যাবলী সংজ্ঞায়িত করতে আমরা প্রথম প্রয়োজন। শ্রেণীবিভাগ এবং ব্যাকরণগত চিহ্ন দলবদ্ধ করতে উভয় আমাদেরকে আরোপ করে অনুমোদন করে। শ্রেণীবিভাগ মিলের উদ্দ্যেশ্যের জন্য চিহ্ন দলবদ্ধ করতে আমাদেরকে অনুমোদন করে (উদাহরণ 'n *'এর জন্য সমস্ত নৌনস)। বৈশিষ্ট্যাবলী চিহ্নের একটি সেট দলবদ্ধ করতে আমাদেরকে অনুমোদন করেন যে থেকে বেছে নে যাবে। উদাহরণের জন্য ('sg' এবং 'pl' একটি একটি বৈশিষ্ট্য 'number' দলবদ্ধ করা হয়ত যাবে)।

আসুন প্রয়োজনীয় অনুচ্ছেদ যোগ করি:

<section-def-cats>

</section-def-cats>
<section-def-attrs>

</section-def-attrs>

আমরা হিসেবে একবচন এবং প্লুরালতে ইন্ফ্লেচ্তিং, নৌনস কেবল 'reই তারপর আমরা নৌনসএর জন্য একটি শ্রেণী যোগ করতে প্রয়োজন বোধ করি, এবং সংখ্যার একটি বৈশিষ্ট্যের সঙ্গে। নিম্নলিখিতের মত কিছু জিনিষ বেশা হবে:

Into section-def-cats add:

<def-cat n="nom">
   <cat-item tags="n.*"/>
</def-cat>

এইটি সমস্ত নৌনস ধরে (লেম্মাস ের মধ্যে অনুসরণ করেছিল<n> তারপর যেকিছু) এবং হিসেবে তাদেরকেতে উল্লেখ করে " nom " (আমরা দেখব যেমন যে পরবর্তী কালে ব্যবহার করা হয়)।

Into the section section-def-attrs, add:

<def-attr n="nbr">
   <attr-item tags="sg"/>
   <attr-item tags="pl"/>
</def-attr>

and then

<def-attr n="a_nom">
   <attr-item tags="n"/>
</def-attr>

প্রথম আরোপ করা nbr সংজ্ঞায়িত করে (সংখ্যা), যেটি হয় একবচন (sg) অথবা প্লুরাল (pl)।

দ্বিতীয় আরোপ করা a_nom সংজ্ঞায়িত করে (নুন আরোপ করুন)।

পরবর্তী আমরা সার্বিক চলকের জন্য একটি অনুচ্ছেদ যোগ করতে প্রয়োজন বোধ করি:

<section-def-vars>

</section-def-vars>

These variables are used to store or transfer attributes between rules. We need only one for now,

<def-var n="number"/>

পরিশেষে, আমরা নুন এবংতে গ্রহণ করতে একটি রুল, যোগ করতে প্রয়োজন বোধ করি তারপর সঠিক ফর্মে বেলুতো এইটি। আমরা একটি নিয়ম অনুচ্ছেদ প্রয়োজন বোধ করব...

<section-rules>

</section-rules>

Changing the pace from the previous examples, I'll just paste this rule, then go through it, rather than the other way round.

<rule>
   <pattern>
     <pattern-item n="nom"/>
   </pattern>
   <action>
     <out>
       <lu>
         <clip pos="1" side="tl" part="lem"/>
         <clip pos="1" side="tl" part="a_nom"/>
         <clip pos="1" side="tl" part="nbr"/>
       </lu>
     </out>
   </action>
</rule>

প্রথম ট্যাগ বোধগম্য, এইটি একটি রুল সংজ্ঞায়িত করে। দ্বিতীয় ট্যাগ, নকশা প্রাথমিকভাবে বলে: " এই রুলটি প্রয়োগ করুন, যদি এই নকশাটি খুঁজে পাওয়া হয় "। এই উদাহরন নকশাতে একটি একক নুনের গঠিত হয় (শ্রেণী পদ nomএর দ্বারা সংজ্ঞায়িত করেছিল)। নোট যে নকশা একটি দীর্ঘতম মেবলে প্রথমে মেবলেওয়া হয়। যদি আপনার সুতরাং তিন নিয়ম, প্রথম ধরা রয়েছে "<prn><vblex><n> ", দ্বিতীয় ধরা "<prn><vblex> " এবং তৃতীয় ধরা "<n> ", নকশা মেবলিয়েছিল, এবং রুল প্রথম রান করেছিল।

প্রত্যেক নকশার জন্য, একটি সহযোগী কার্য আছে, যেটি একটি সহযোগী বেলুতো, বাইরে তৈরি করে। বেলুতো, একটি লেক্সাল অংশ (lu)।

ক্লিপ ট্যাগ নির্বাচন করতে একটি ব্যবহারকারী অনুমোদন করে এবং বৈশিষ্ট্যাবলী নিপুণভাবে ব্যবহার করুন এবং সূত্র ভাষার অংশ (side= " এস. এল. "), অথবা লক্ষ্য ভাষা (side= " tl ") লেক্সাল পদ।

আসুন এইটি এবং পরীক্ষা এইটি সঙ্কলন করি। ট্রান্সফার নিয়ম ের সঙ্গে সঙ্কলন করা হয়:

$ apertium-preprocess-transfer apertium-sh-en.sh-en.t1x sh-en.t1x.bin

একটি কোন উৎ‍পাদন করবে sh-en t1x bins ফাইল।

আমরা এখন আমাদের মেশিন অনুবাদ পদ্ধতি পরীক্ষা করতে তৈরি 'reই। একটি গুরুত্বপূর্ণ খন্ড লক্ষ্যভ্রষ্ট হচ্ছে, বাকের খন্ড (PoS) ট্যাগার, কিন্তু সেইটি সল্প সময়ে ব্যাখ্যা করা হবে। আমরা এখন হ হিসেবে এইটি পরীক্ষা করতে পারি:

প্রথম, একটি কথা, গ্রামফনি বিশ্লেষণ করতে দেয়:

$ echo "gramofoni" | lt-proc sh-en.automorf.bin 
^gramofon/gramofon<n><pl>$

এখন, POS ট্যাগার সাধারণভাবে এখানে বাকের খন্ডে ঠিক সংস্করণ বেছে নেবে ভিত্তি করবে, কিন্তু আমাদের একটি POS ট্যাগার এখনও নেই, সুতরাং আমরা এই ছোট gawkটি লিপি ব্যবহার করতে পারি (Sergioতে ধন্যবাদ) যে প্রথম পদ মাত্র আউটপুটব আহরন করব।

$ echo "gramofoni" | lt-proc sh-en.automorf.bin | \
  gawk 'BEGIN{RS="$"; FS="/";}{nf=split($1,COMPONENTS,"^"); for(i = 1; i<nf; i++) printf COMPONENTS[i]; if($2 != "") printf("^%s$",$2);}'
^gramofon<n><pl>$

ের পদ্ধতি এখন যে স্থানান্তর রুলের সঙ্গে:

$ echo "gramofoni" | lt-proc sh-en.automorf.bin | \
  gawk 'BEGIN{RS="$"; FS="/";}{nf=split($1,COMPONENTS,"^"); for(i = 1; i<nf; i++) printf COMPONENTS[i]; if($2 != "") printf("^%s$",$2);}' | \
  apertium-transfer apertium-sh-en.sh-en.t1x sh-en.t1x.bin sh-en.autobil.bin

এইটি আউটপুটবে:

^gramophone<n><pl>$^@
  • 'gramophone' লক্ষ্য কি ভাষা (side="tl") লেম্মা (lem) অবস্থান ১তে (pos="1")।
  • '<n>' অবস্থান ১তে লক্ষ্য কি ভাষা a_nom।
  • '<pl>' লক্ষ্য কি ভাষা সংখ্যার আরোপ করে (nbr) অবস্থান ১তে।

Try commenting out one of these clip statements, recompiling and seeing what happens.

So, now we have the output from the transfer, the only thing that remains is to generate the target-language inflected forms. For this, we use lt-proc, but in generation (-g), not analysis mode.

$ echo "gramofoni" | lt-proc sh-en.automorf.bin | \
  gawk 'BEGIN{RS="$"; FS="/";}{nf=split($1,COMPONENTS,"^"); for(i = 1; i<nf; i++) printf COMPONENTS[i]; if($2 != "") printf("^%s$",$2);}' | \
  apertium-transfer apertium-sh-en.sh-en.t1x sh-en.t1x.bin sh-en.autobil.bin | \
  lt-proc -g sh-en.autogen.bin

gramophones\@

And c'est ca. You now have a machine translation system that translates a Serbo-Croatian noun into an English noun. Obviously this isn't very useful, but we'll get onto the more complex stuff soon. Oh, and don't worry about the '@' symbol, I'll explain that soon too.

Think of a few other words that inflect the same as gramofon. How about adding those. We don't need to add any paradigms, just the entries in the main section of the monolingual and bilingual dictionaries.

Bring on the verbs

Ok, so we have a system that translates nouns, but thats pretty useless, we want to translate verbs too, and even whole sentences! How about we start with the verb to see. In Serbo-Croatian this is videti. Serbo-Croatian is a null-subject language, this means that it doesn't typically use personal pronouns before the conjugated form of the verb. English is not. So for example: I see in English would be translated as vidim in Serbo-Croatian.

  • Vidim
  • see<p1><sg>
  • I see

Note: <p1> denotes first person

This will be important when we come to write the transfer rule for verbs. Other examples of null-subject languages include: Spanish, Romanian and Polish. This also has the effect that while we only need to add the verb in the Serbo-Croatian morphological dictionary, we need to add both the verb, and the personal pronouns in the English morphological dictionary. We'll go through both of these.

The other forms of the verb videti are: vidiš, vidi, vidimo, vidite, and vide; which correspond to: you see (singular), he sees, we see, you see (plural), and they see.

There are two forms of you see, one is plural and formal singular (vidite) and the other is singular and informal (vidiš).

We're going to try and translate the sentence: "Vidim gramofoni" into "I see gramophones". In the interests of space, we'll just add enough information to do the translation and will leave filling out the paradigms (adding the other conjugations of the verb) as an exercise to the reader.

The astute reader will have realised by this point that we can't just translate vidim gramofoni because it is not a grammatically correct sentence in Serbo-Croatian. The correct sentence would be vidim gramofone, as the noun takes the accusative case. We'll have to add that form too, no need to add the case information for now though, we just add it as another option for plural. So, just copy the 'e' block for 'i' and change the 'i' to 'e' there.

First thing we need to do is add some more symbols. We need to first add a symbol for 'verb', which we'll call "vblex" (this means lexical verb, as opposed to modal verbs and other types). Verbs have 'person', and 'tense' along with number, so lets add a couple of those as well. We need to translate "I see", so for person we should add "p1", or 'first person', and for tense "pri", or 'present indicative'.

<sdef n="vblex"/>
<sdef n="p1"/>
<sdef n="pri"/>

After we've done this, the same with the nouns, we add a paradigm for the verb conjugation. The first line will be:

<pardef n="vid/eti__vblex">

The '/' is used to demarcate where the stems (the parts between the <l> </l> tags) are added to.

Then the inflection for first person singular:


<e><p><l>im</l><r>eti<s n="vblex"/><s n="pri"/><s n="p1"/><s n="sg"/></r></p></e>

The 'im' denotes the ending (as in 'vidim'), it is necessary to add 'eti' to the <r> section, as this will be chopped off by the definition. The rest is fairly straightforward, 'vblex' is lexical verb, 'pri' is present indicative tense, 'p1' is first person and 'sg' is singular. We can also add the plural which will be the same, except 'imo' instead of 'im' and 'pl' instead of 'sg'.

After this we need to add a lemma, paradigm mapping to the main section:

<e lm="videti"><i>vid</i><par n="vid/eti__vblex"/></e>

Note: the content of <i> </i> is the root, not the lemma.

Thats the work on the Serbo-Croatian dictionary done for now. Lets compile it then test it.

$ lt-comp lr apertium-sh-en.sh.dix sh-en.automorf.bin
main@standard 23 25
$ echo "vidim" | lt-proc sh-en.automorf.bin
^vidim/videti<vblex><pri><p1><sg>$
$ echo "vidimo" | lt-proc sh-en.automorf.bin
^vidimo/videti<vblex><pri><p1><pl>$

Ok, so now we do the same for the English dictionary (remember to add the same symbol definitions here as you added to the Serbo-Croatian one).

The paradigm is:

<pardef n="s/ee__vblex">

because the past tense is 'saw'. Now, we can do one of two things, we can add both first and second person, but they are the same form. In fact, all forms (except third person singular) of the verb 'to see' are 'see'. So instead we make one entry for 'see' and give it only the 'pri' symbol.


<e><p><l>ee</l><r>ee<s n="vblex"/><s n="pri"/></r></p></e>

and as always, an entry in the main section:

<e lm="see"><i>s</i><par n="s/ee__vblex"/></e>

Then lets save, recompile and test:

$ lt-comp lr apertium-sh-en.en.dix en-sh.automorf.bin
main@standard 18 19

$ echo "see" | lt-proc en-sh.automorf.bin
^see/see<vblex><pri>$

Now for the obligatory entry in the bilingual dictionary:

<e><p><l>videti<s n="vblex"/></l><r>see<s n="vblex"/></r></p></e>

(again, don't forget to add the sdefs from earlier)

And recompile:

$ lt-comp lr apertium-sh-en.sh-en.dix sh-en.autobil.bin
main@standard 18 18
$ lt-comp rl apertium-sh-en.sh-en.dix en-sh.autobil.bin
main@standard 18 18

Now to test:

$ echo "vidim" | lt-proc sh-en.automorf.bin | \
  gawk 'BEGIN{RS="$"; FS="/";}{nf=split($1,COMPONENTS,"^"); for(i = 1; i<nf; i++) printf COMPONENTS[i]; if($2 != "") printf("^%s$",$2);}' | \
  apertium-transfer apertium-sh-en.sh-en.t1x sh-en.t1x.bin sh-en.autobil.bin

^see<vblex><pri><p1><sg>$^@

We get the analysis passed through correctly, but when we try and generate a surface form from this, we get a '#', like below:

$ echo "vidim" | lt-proc sh-en.automorf.bin | \
  gawk 'BEGIN{RS="$"; FS="/";}{nf=split($1,COMPONENTS,"^"); for(i = 1; i<nf; i++) printf COMPONENTS[i]; if($2 != "") printf("^%s$",$2);}' | \
  apertium-transfer apertium-sh-en.sh-en.t1x sh-en.t1x.bin sh-en.autobil.bin | \
  lt-proc -g sh-en.autogen.bin
#see\@

This '#' means that the generator cannot generate the correct lexical form because it does not contain it. Why is this?

Basically the analyses don't match, the 'see' in the dictionary is see<vblex><pri>, but the see delivered by the transfer is see<vblex><pri><p1><sg>. The Serbo-Croatian side has more information than the English side requires. You can test this by adding the missing symbols to the English dictionary, and then recompiling, and testing again.

However, a more paradigmatic way of taking care of this is by writing a rule. So, we open up the rules file (apertium-sh-en.sh-en.t1x sh-en.t1x.bin sh-en.autobil.bin in case you forgot).

We need to add a new category for 'verb'.

<def-cat n="vrb">
   <cat-item tags="vblex.*"/>
</def-cat>

We also need to add attributes for tense and for person. We'll make it really simple for now, you can add p2 and p3, but I won't in order to save space.

<def-attr n="temps">
   <attr-item tags="pri"/>
</def-attr>

<def-attr n="pers">
   <attr-item tags="p1"/>
</def-attr>

We should also add an attribute for verbs.

<def-attr n="a_verb">
   <attr-item tags="vblex"/>
</def-attr>

Now onto the rule:

<rule>
   <pattern>
     <pattern-item n="vrb"/>
   </pattern>
   <action>
     <out>
       <lu>
         <clip pos="1" side="tl" part="lem"/>
         <clip pos="1" side="tl" part="a_verb"/>
         <clip pos="1" side="tl" part="temps"/>
       </lu>
     </out>
   </action>
</rule>

Remember when you tried commenting out the 'clip' tags in the previous rule example and they disappeared from the transfer, well, thats pretty much what we're doing here. We take in a verb with a full analysis, but only output a partial analysis (lemma + verb tag + tense tag).

So now, if we recompile that, we get:

$ echo "vidim" | lt-proc sh-en.automorf.bin | \
  gawk 'BEGIN{RS="$"; FS="/";}{nf=split($1,COMPONENTS,"^"); for(i = 1; i<nf; i++) printf COMPONENTS[i]; if($2 != "") printf("^%s$",$2);}' | \
  apertium-transfer apertium-sh-en.sh-en.t1x sh-en.t1x.bin sh-en.autobil.bin
^see<vblex><pri>$^@

and:

$ echo "vidim" | lt-proc sh-en.automorf.bin  | \
  gawk 'BEGIN{RS="$"; FS="/";}{nf=split($1,COMPONENTS,"^"); for(i = 1; i<nf; i++) printf COMPONENTS[i]; if($2 != "") printf("^%s$",$2);}' | \
  apertium-transfer apertium-sh-en.sh-en.t1x sh-en.t1x.bin sh-en.autobil.bin | \
  lt-proc -g sh-en.autogen.bin
see\@

Try it with 'vidimo' (we see) to see if you get the correct output.

Now try it with "vidim gramofone":

$ echo "vidim gramofoni" | lt-proc sh-en.automorf.bin | \
  gawk 'BEGIN{RS="$"; FS="/";}{nf=split($1,COMPONENTS,"^"); for(i = 1; i<nf; i++) printf COMPONENTS[i]; if($2 != "") printf("^%s$",$2);}' | \
  apertium-transfer apertium-sh-en.sh-en.t1x sh-en.t1x.bin sh-en.autobil.bin | \
  lt-proc -g sh-en.autogen.bin
see gramophones\@

But what about personal pronouns?

Well, thats great, but we're still missing the personal pronoun that is necessary in English. In order to add it in, we first need to edit the English morphological dictionary.

As before, the first thing to do is add the necessary symbols:

<sdef n="prn"/>
<sdef n="subj"/>

Of the two symbols, prn is pronoun, and subj is subject (as in the subject of a sentence).

Because there is no root, or 'lemma' for personal subject pronouns, we just add the pardef as follows:

<pardef n="prsubj__prn">
   <e><p><l>I</l><r>prpers<s n="prn"/><s n="subj"/><s n="p1"/><s n="sg"/></r></p></e>
</pardef>

With 'prsubj' being 'personal subject'. The rest of them (You, We etc.) are left as an exercise to the reader.

We can add an entry to the main section as follows:

<e lm="personal subject pronouns"><i/><par n="prsubj__prn"/></e>

So, save, recompile and test, and we should get something like:

$ echo "I" | lt-proc en-sh.automorf.bin
^I/PRPERS<prn><subj><p1><sg>$

(Note: it's in capitals because 'I' is in capitals).

Now we need to amend the 'verb' rule to output the subject personal pronoun along with the correct verb form.

First, add a category (this must be getting pretty pedestrian by now):

<def-cat n="prpers">
   <cat-item lemma="prpers" tags="prn.*"/>
</def-cat>

Now add the types of pronoun as attributes, we might as well add the 'obj' type as we're at it, although we won't need to use it for now:

<def-attr n="tipus_prn">
   <attr-item tags="prn.subj"/>
   <attr-item tags="prn.obj"/>
</def-attr>

And now to input the rule:

<rule>
   <pattern>
     <pattern-item n="vrb"/>
   </pattern>
   <action>
     <out>
       <lu>
         <lit v="prpers"/>
         <lit-tag v="prn"/>
         <lit-tag v="subj"/>
         <clip pos="1" side="tl" part="pers"/>
         <clip pos="1" side="tl" part="nbr"/>
       </lu>
       <b/>
       <lu>
         <clip pos="1" side="tl" part="lem"/>
         <clip pos="1" side="tl" part="a_verb"/>
         <clip pos="1" side="tl" part="temps"/>
       </lu>
     </out>
   </action>
</rule>

This is pretty much the same rule as before, only we made a couple of small changes.

We needed to output:

^prpers<prn><subj><p1><sg>$ ^see<vblex><pri>$

so that the generator could choose the right pronoun and the right form of the verb.

So, a quick rundown:

  • <lit>, prints a literal string, in this case "prpers"
  • <lit-tag>, prints a literal tag, because we can't get the tags from the verb, we add these ourself, "prn" for pronoun, and "subj" for subject.
  • , prints a blank, a space.

Note that we retrieved the information for number and tense directly from the verb.

So, now if we recompile and test that again:

$ echo "vidim gramofone" | lt-proc sh-en.automorf.bin  | \
  gawk 'BEGIN{RS="$"; FS="/";}{nf=split($1,COMPONENTS,"^"); for(i = 1; i<nf; i++) printf COMPONENTS[i]; if($2 != "") printf("^%s$",$2);}' | \
  apertium-transfer apertium-sh-en.sh-en.t1x sh-en.t1x.bin sh-en.autobil.bin | \
  lt-proc -g sh-en.autogen.bin
I see gramophones

Which, while it isn't exactly prize-winning prose (much like this HOWTO), is a fairly accurate translation.

So tell me about the record player (Multiwords)

While gramophone is an English word, it isn't the best translation. Gramophone is typically used for the very old kind, you know with the needle instead of the stylus, and no powered amplification. A better translation would be 'record player'. Although this is more than one word, we can treat it as if it is one word by using multiword (multipalabra) constructions.

We don't need to touch the Serbo-Croatian dictionary, just the English one and the bilingual one, so open it up.

The plural of 'record player' is 'record players', so it takes the same paradigm as gramophone (gramophone__n) — in that we just add 's'. All we need to do is add a new element to the main section.

<e lm="record player"><i>record<b/>player</i><par n="gramophone__n"/></e>

The only thing different about this is the use of the tag, although this isn't entirely new as we saw it in use in the rules file.

So, recompile and test in the orthodox fashion:

$ echo "vidim gramofone" | lt-proc sh-en.automorf.bin | \
  gawk 'BEGIN{RS="$"; FS="/";}{nf=split($1,COMPONENTS,"^"); for(i = 1; i<nf; i++) printf COMPONENTS[i]; if($2 != "") printf("^%s$",$2);}' | \
  apertium-transfer apertium-sh-en.sh-en.t1x sh-en.t1x.bin sh-en.autobil.bin  | \
  lt-proc -g sh-en.autogen.bin
I see record players

Perfect. A big benefit of using multiwords is that you can translate idiomatic expressions verbatim, without having to do word-by-word translation. For example the English phrase, "at the moment" would be translated into Serbo-Croatian as "trenutno" (trenutak = moment, trenutno being adverb of that) — it would not be possible to translate this English phrase word-by-word into Serbo-Croatian.

Dealing with minor variation

Serbo-Croatian typically has a few ways of writing each word because of dialectal variation. It has a cool phonetic writing system so you write how you speak. For example, people speaking in Ijekavian would say "rječnik", while someone speaking Ekavian would say "rečnik", which reflects the differences in pronunciation of the proto-Slavic vowel yat.

Analysis

There should be a fairly easy way of dealing with this, and there is, using paradigms again. Paradigms aren't only used for adding grammatical symbols, but they can also be used to replace any character/symbol with another. For example, here is a paradigm for accepting both "e" and "je" in the analysis. The paradigm should, as with the others go into the monolingual dictionary for Serbo-Croatian.

  <pardef n="e_je__yat">
    <e>
      <p>
        <l>e</l>
        <r>e</r>
      </p>
    </e>
    <e>
      <p>
        <l>je</l>
        <r>e</r>
      </p>
    </e>
  </pardef>

Then in the "main section":

    <e lm="rečnik"><i>r</i><par n="e_je__yat"/><i>čni</i><par n="rečni/k__n"/></e>

This only allows us to analyse both forms however... more work is necessary if we want to generate both forms.

Generation

See also