Page MenuHomePhabricator

[Migrated] Merge other uses template
Open, LowPublic

Description

Since AWB already merges {{for}} and {{about}}, would it make sense to also include {{other uses}} into this merging? I could come up with some logic if you're interested. @GoingBatty 06:39, 30 December 2013 (UTC)

Event Timeline

Reguyla raised the priority of this task from to Needs Triage.
Reguyla updated the task description. (Show Details)
Reguyla added a project: AutoWikiBrowser.
Reguyla moved this task to Feature request (unsorted) on the AutoWikiBrowser board.

@Magioladitis 07:33, 30 December 2013 (UTC) wrote:
@GoingBatty I would be interested. What are the rules?

@GoingBatty 04:03, 31 December 2013 (UTC) wrote:
@Magioladitis - Here's a start on the logic, but it's too greedy (i.e. if {{tl|for}} has more than three parameters, such as https://en.wikipedia.org/wiki/Systematics:

<source lang="C">
      <Replacement>
        <Find>{{for\s*?\|(.*?)\|(.*?)\|(.*?)}}\s*{{other uses\s*\|(.*?)}}</Find>
        <Replace>{{about||$1|$2|and|$3|other uses|$4}}</Replace>
        <Comment />
        <IsRegex>true</IsRegex>
        <Enabled>true</Enabled>
        <Minor>false</Minor>
        <BeforeOrAfter>true</BeforeOrAfter>
        <RegularExpressionOptions>IgnoreCase</RegularExpressionOptions>
      </Replacement>
      <Replacement>
        <Find>{{for\s*?\|(.*?)\|(.*?)}}\s*{{other uses\s*\|(.*?)}}</Find>
        <Replace>{{about||$1|$2|other uses|$3}}</Replace>
        <Comment />
        <IsRegex>true</IsRegex>
        <Enabled>true</Enabled>
        <Minor>false</Minor>
        <BeforeOrAfter>true</BeforeOrAfter>
        <RegularExpressionOptions>IgnoreCase</RegularExpressionOptions>
      </Replacement>
      <Replacement>
        <Find>{{for\s*?\|(.*?)\|(.*?)\|(.*?)}}\s*{{other uses}}</Find>
        <Replace>{{about||$1|$2|and|$3|other uses}}</Replace>
        <Comment />
        <IsRegex>true</IsRegex>
        <Enabled>true</Enabled>
        <Minor>false</Minor>
        <BeforeOrAfter>true</BeforeOrAfter>
        <RegularExpressionOptions>IgnoreCase</RegularExpressionOptions>
      </Replacement>
      <Replacement>
        <Find>{{for\s*?\|(.*?)\|(.*?)}}\s*{{other uses}}</Find>
        <Replace>{{about||$1|$2|other uses}}</Replace>
        <Comment />
        <IsRegex>true</IsRegex>
        <Enabled>true</Enabled>
        <Minor>false</Minor>
        <BeforeOrAfter>true</BeforeOrAfter>
        <RegularExpressionOptions>IgnoreCase</RegularExpressionOptions>
      </Replacement>
      <Replacement>
        <Find>{{other uses\s*\|(.*?)}}\s*{{for\s*?\|(.*?)\|(.*?)\|(.*?)}}</Find>
        <Replace>{{about||$2|$3|and|$4|other uses|$1}}</Replace>
        <Comment />
        <IsRegex>true</IsRegex>
        <Enabled>true</Enabled>
        <Minor>false</Minor>
        <BeforeOrAfter>true</BeforeOrAfter>
        <RegularExpressionOptions>IgnoreCase</RegularExpressionOptions>
      </Replacement>
      <Replacement>
        <Find>{{other uses\s*\|(.*?)}}\s*{{for\s*?\|(.*?)\|(.*?)}}</Find>
        <Replace>{{about||$2|$3|other uses|$1}}</Replace>
        <Comment />
        <IsRegex>true</IsRegex>
        <Enabled>true</Enabled>
        <Minor>false</Minor>
        <BeforeOrAfter>true</BeforeOrAfter>
        <RegularExpressionOptions>IgnoreCase</RegularExpressionOptions>
      </Replacement>
      <Replacement>
        <Find>{{other uses}}\s*{{for\s*?\|(.*?)\|(.*?)\|(.*?)}}</Find>
        <Replace>{{about||$1|$2|and|$3|other uses}}</Replace>
        <Comment />
        <IsRegex>true</IsRegex>
        <Enabled>true</Enabled>
        <Minor>false</Minor>
        <BeforeOrAfter>true</BeforeOrAfter>
        <RegularExpressionOptions>IgnoreCase</RegularExpressionOptions>
      </Replacement>
      <Replacement>
        <Find>{{other uses}}\s*{{for\s*?\|(.*?)\|(.*?)}}</Find>
        <Replace>{{about||$1|$2|other uses}}</Replace>
        <Comment />
        <IsRegex>true</IsRegex>
        <Enabled>true</Enabled>
        <Minor>false</Minor>
        <BeforeOrAfter>true</BeforeOrAfter>
        <RegularExpressionOptions>IgnoreCase</RegularExpressionOptions>
      </Replacement>
      <Replacement>
        <Find>{{about\s*?\|(.*?)\|(.*?)\|(.*?)}}\s*{{other uses\s*\|(.*?)}}</Find>
        <Replace>{{about|$1|$2|$3|other uses|$4}}</Replace>
        <Comment />
        <IsRegex>true</IsRegex>
        <Enabled>true</Enabled>
        <Minor>false</Minor>
        <BeforeOrAfter>true</BeforeOrAfter>
        <RegularExpressionOptions>IgnoreCase</RegularExpressionOptions>
      </Replacement>
      <Replacement>
        <Find>{{about\s*?\|(.*?)\|(.*?)\|(.*?)}}\s*{{other uses}}</Find>
        <Replace>{{about|$1|$2|$3|other uses}}</Replace>
        <Comment />
        <IsRegex>true</IsRegex>
        <Enabled>true</Enabled>
        <Minor>false</Minor>
        <BeforeOrAfter>true</BeforeOrAfter>
        <RegularExpressionOptions>IgnoreCase</RegularExpressionOptions>
      </Replacement>
      <Replacement>
        <Find>{{other uses\s*\|(.*?)}}\s*{{about\s*?\|(.*?)\|(.*?)\|(.*?)}}</Find>
        <Replace>{{about|$2|$3|$4|other uses|$1}}</Replace>
        <Comment />
        <IsRegex>true</IsRegex>
        <Enabled>true</Enabled>
        <Minor>false</Minor>
        <BeforeOrAfter>true</BeforeOrAfter>
        <RegularExpressionOptions>IgnoreCase</RegularExpressionOptions>
      </Replacement>
      <Replacement>
        <Find>{{other uses}}\s*{{about\s*?\|(.*?)\|(.*?)\|(.*?)}}</Find>
        <Replace>{{about|$1|$2|$3|other uses}}</Replace>
        <Comment />
        <IsRegex>true</IsRegex>
        <Enabled>true</Enabled>
        <Minor>false</Minor>
        <BeforeOrAfter>true</BeforeOrAfter>
        <RegularExpressionOptions>IgnoreCase</RegularExpressionOptions>
      </Replacement>
</source>

Thanks for your consideration!

Aklapper triaged this task as Low priority.Feb 10 2023, 12:06 PM