## 6 Complexity Analysis
### Time Complexity
```
Input:Urdu News Article (UNA) and archived English News Article (ENA) \(\in\) DNSA Output: Similarity Score of UNA against ENA
1 UNA Pre-processing // Filtering non-news contents and extracts the Urdu language news article from the news webpage during extraction /* Compute Term Frequencies of Urdu News Articles */
2 Tokenize Urdu news article contents (Creating a set of Urdu Terms)
3 i.e., \(T_{u}=\{t_{1},t_{2},t_{3},\ldots,t_{n}\}\)
4 Remove stopwords (if any)
5 for\(t_{i}\in T_{u}\) upto\(n\)do
6 Find tf for each term t from T
7 Update Map(UNA) // using UNA Map for Word w and its frequency
8 Map(UNA) = {(tf\({}_{1}\), w\({}_{1}\)), (tf\({}_{2}\), w\({}_{2}\)), (tf\({}_{3}\), w\({}_{3}\)),..., (tf\({}_{i}\), w\({}_{i}\))} // UNA Map
9 Identify the English meaning of each Urdu term in the dictionary (Urdu-to-English)
10 Identify multiple meanings for each Urdu word (if any) // For example, for Urdu word \"BARTAO\", many words can be used in a similar English news article, that is, Behave, Behaviour, Conduct, Treat, etc. 11 for\(ENA\in DNSA\)do /* Compute Term Frequencies of English News Articles */
12 Tokenize English news article contents (Creating set of English Terms)
13 i.e., \(T_{e}=\{t_{1},t_{2},t_{3},\ldots,t_{m}\}\)
14 Remove stopwords (if any)
15 for\(t_{i}\in T_{e}\) upto\(m\)do
16 Find tf for each term t from T
17 Update Map(ENA) // using ENA Map for Word w and its frequency
18 Map(ENA) = {(tf\({}_{1}\), w\({}_{1}\)), (tf\({}_{2}\), w\({}_{2}\)), (tf\({}_{3}\), w\({}_{3}\)),..., (tf\({}_{i}\), w\({}_{i}\))} // ENA Map
19 Map(ENA) = {(tf\({}_{1}\), w\({}_{1}\)), (tf\({}_{2}\), w\({}_{2}\)), (tf\({}_{3}\), w\({}_{3}\)),..., (tf\({}_{i}\), w\({}_{i}\))} // ENA Map
20 Map(UNA) = {(tf\({}_{1}\), w\({}_{1}\)), (tf\({}_{2}\), w\({}_{2}\)), (tf\({}_{3}\), w\({}_{3}\)),..., (tf\({}_{i}\), w\({}_{i}\))} // UNA Map, already created /* Compute CT (Common Terms) Count */
21 CT = (tf\({}_{1}\) + tf\({}_{2}\))W\({}_{1}\) + (tf\({}_{1}\) + tf\({}_{2}\))W\({}_{2}\) +... + (tf\({}_{1}\) + tf\({}_{2}\))W\({}_{cw}\) = \(\sum\limits_{i=1}^{cw}\) (tf\({}_{1}\) + tf\({}_{2}\))W\({}_{i}\) /* Where W\({}_{i}\) is the common term or word in both the news articles, i.e., Urdu and English, _tf\({}_{1}\)_ term frequency of word W in UNA, _tf\({}_{2}\)_ is term frequency of word W in ENA, cw is the total number of common terms in both the news articles and (_tf\({}_{1}\) + tf\({}_{2}\))W\({}_{i}\) is interpreted as \"adding term frequency of common word W\({}_{i}\) from UNA, i.e., _tf\({}_{1}\)_ and ENA, i.e., _tf\({}_{2}\)_\". */ /* Compute UT (Uncommon Terms) Count */ // Select all uncommon terms in both the news articles
22 UT = (tf\({}_{1}\) \(\vee\) tf\({}_{2}\))W\({}_{1}\) + (tf\({}_{1}\) \(\vee\) tf\({}_{2}\))W\({}_{2}\) +... + (tf\({}_{1}\) \(\vee\) tf\({}_{2}\))W\({}_{uw}\) = \(\sum\limits_{j=1}^{lW}\)(tf\({}_{1}\) \(\vee\) tf\({}_{2}\))W\({}_{j}\) // Where \(uw\) is the total number of uncommon words in both the news articles /* Compute TT (Total Terms) Count */ // The total terms in both the news articles can be calculated as;
23 TT = UT + CT /* Compute Common Ratio Measure for Dual Languages */
24 CRMDL = CT/TT
```  
**Algorithm 1**CRMDL Algorithm Pseudo-Code``` Input: New News Article (NNA) and Archived News Articles (ANA) \(\in\) DNSA Output: Similarity Score of NNA with ANA // NNA is an Urdu news and ANA are English news articles
1 NNA preprocessing // Filtering non-news contents and extracting the news article from the news webpage during extraction
2 Tokenize NNA \(\text{T}=t_{1},t_{2},t_{3},\ldots,t_{n}\)
4 Removing stopwords (if any)
5 Computing term frequency (TF) of each term in NNA // Find the English meaning of each Urdu word in Urdu-to-English Dictionary (U2E-Lexicon) Or in Transliteration words List (TWL)
6 for\(w_{i}\in\) Map(NNA)do// If word exists in U2E-Lexicon
7 if\(w_{i}\in\) U2E-Lexicon OR \(w_{i}\in\) TWLthen// For a single Urdu word, multiple meanings should identify; for example, for brtAw many words can be used in a similar English news article is, Behave, Behaviour, Conduct, Treat, etc.