Title: Module:Distinguish - freem URL Source: https://freemwiki.com/index.php?oldid=579763&title=Module%3ADistinguish Markdown Content: From freem _Documentation for this module may be created at [Module:Distinguish/doc](https://freemwiki.com/index.php?title=Module:Distinguish/doc&action=edit&redlink=1 "Module:Distinguish/doc (page does not exist)")_ [](https://freemwiki.com/index.php?oldid=579763&title=Module%3ADistinguish#L-1)local mHatnote = require(['Module:Hatnote'](https://freemwiki.com/wiki/Module:Hatnote))[](https://freemwiki.com/index.php?oldid=579763&title=Module%3ADistinguish#L-2)local mHatlist = require(['Module:Hatnote list'](https://freemwiki.com/wiki/Module:Hatnote_list))[](https://freemwiki.com/index.php?oldid=579763&title=Module%3ADistinguish#L-3)local mArguments --initialize lazily[](https://freemwiki.com/index.php?oldid=579763&title=Module%3ADistinguish#L-4)local mTableTools --initialize lazily[](https://freemwiki.com/index.php?oldid=579763&title=Module%3ADistinguish#L-5)local libraryUtil = require('libraryUtil')[](https://freemwiki.com/index.php?oldid=579763&title=Module%3ADistinguish#L-6)local checkType = libraryUtil.checkType[](https://freemwiki.com/index.php?oldid=579763&title=Module%3ADistinguish#L-7)local p = {}[](https://freemwiki.com/index.php?oldid=579763&title=Module%3ADistinguish#L-8)[](https://freemwiki.com/index.php?oldid=579763&title=Module%3ADistinguish#L-9)function p.distinguish(frame)[](https://freemwiki.com/index.php?oldid=579763&title=Module%3ADistinguish#L-10)mArguments = require(['Module:Arguments'](https://freemwiki.com/wiki/Module:Arguments))[](https://freemwiki.com/index.php?oldid=579763&title=Module%3ADistinguish#L-11)mTableTools = require(['Module:TableTools'](https://freemwiki.com/wiki/Module:TableTools))[](https://freemwiki.com/index.php?oldid=579763&title=Module%3ADistinguish#L-12)local args = mArguments.getArgs(frame)[](https://freemwiki.com/index.php?oldid=579763&title=Module%3ADistinguish#L-13)local selfref = args.selfref[](https://freemwiki.com/index.php?oldid=579763&title=Module%3ADistinguish#L-14)local text = args.text[](https://freemwiki.com/index.php?oldid=579763&title=Module%3ADistinguish#L-15)args = mTableTools.compressSparseArray(args)[](https://freemwiki.com/index.php?oldid=579763&title=Module%3ADistinguish#L-16)return p._distinguish(args, text, selfref)[](https://freemwiki.com/index.php?oldid=579763&title=Module%3ADistinguish#L-17)end[](https://freemwiki.com/index.php?oldid=579763&title=Module%3ADistinguish#L-18)[](https://freemwiki.com/index.php?oldid=579763&title=Module%3ADistinguish#L-19)function p._distinguish(args, text, selfref)[](https://freemwiki.com/index.php?oldid=579763&title=Module%3ADistinguish#L-20)checkType("_distinguish", 1, args, 'table')[](https://freemwiki.com/index.php?oldid=579763&title=Module%3ADistinguish#L-21)if #args == 0 and not text then return '' end[](https://freemwiki.com/index.php?oldid=579763&title=Module%3ADistinguish#L-22)local text = string.format([](https://freemwiki.com/index.php?oldid=579763&title=Module%3ADistinguish#L-23)'Not to be confused with %s.',[](https://freemwiki.com/index.php?oldid=579763&title=Module%3ADistinguish#L-24)text or mHatlist.orList(args, true)[](https://freemwiki.com/index.php?oldid=579763&title=Module%3ADistinguish#L-25))[](https://freemwiki.com/index.php?oldid=579763&title=Module%3ADistinguish#L-26)hnOptions = {selfref = selfref}[](https://freemwiki.com/index.php?oldid=579763&title=Module%3ADistinguish#L-27)return mHatnote._hatnote(text, hnOptions)[](https://freemwiki.com/index.php?oldid=579763&title=Module%3ADistinguish#L-28)end[](https://freemwiki.com/index.php?oldid=579763&title=Module%3ADistinguish#L-29)[](https://freemwiki.com/index.php?oldid=579763&title=Module%3ADistinguish#L-30)return p